name: Build and Push Alpine NGINX Image to docker.io Registry on: push: branches: - master jobs: build: name: Build and push image (root user) runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check out repository code uses: actions/checkout@v3 - name: Login to docker.io Registry uses: docker/login-action@v3 with: registry: docker.io username: aprimediet password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: context: . file: Dockerfile.alpine build-args: | REGISTRY_URL=aprimediet push: true tags: | aprimediet/nginx:alpine aprimediet/nginx:latest-alpine aprimediet/nginx:latest build-rootless: name: Build and push image (rootless) runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check out repository code uses: actions/checkout@v3 - name: Login to docker.io Registry uses: docker/login-action@v3 with: registry: docker.io username: aprimediet password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 with: context: . file: Dockerfile.alpine-rootless build-args: | REGISTRY_URL=aprimediet push: true tags: | aprimediet/nginx:rootless-alpine aprimediet/nginx:rootless aprimediet/nginx:latest-rootless-alpine aprimediet/nginx:latest-rootless