Skip to content

Merge pull request #36 from fcorso2016/feature/non-root-user-docker #67

Merge pull request #36 from fcorso2016/feature/non-root-user-docker

Merge pull request #36 from fcorso2016/feature/non-root-user-docker #67

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
file: ./Dockerfile
- name: Update latest tag on main branch
if: github.ref == 'refs/heads/dev'
run: |
docker pull ghcr.io/${{ github.repository }}:${{ github.sha }}
docker tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:latest