name: build-docker-image on: push: branches: - master pull_request: branches: - '*' jobs: build: runs-on: almalinux-8 container: image: docker:dind options: --privileged steps: - name: Set up environment run: | apk add --no-cache make bash git - name: Build Docker Image run: | make build push: if: github.ref == 'refs/heads/master' && github.event_name == 'push' runs-on: almalinux-8 container: image: docker:dind options: --privileged steps: - name: Set up environment run: | apk add --no-cache make bash git - name: Log in to Docker env: UPLOAD_USER: ${{ secrets.UPLOAD_USER }} UPLOAD_PASS: ${{ secrets.UPLOAD_PASS }} run: | echo "$UPLOAD_PASS" | docker login --username=$UPLOAD_USER --password-stdin git.query.consul - name: Push Docker Image run: | make push clean: runs-on: almalinux-8 container: image: docker:dind options: --privileged steps: - name: Set up environment run: | apk add --no-cache make bash git - name: Clean Up run: | make clean