diff --git a/.github/workflows/build-arch-images.yml b/.github/workflows/build-arch-images.yml index 8486ffe..5043917 100644 --- a/.github/workflows/build-arch-images.yml +++ b/.github/workflows/build-arch-images.yml @@ -28,6 +28,7 @@ jobs: ] env: ABSOLUTE_DH_IMAGE: docker.io/corysanin/archy-build-thing + DEPLOY: github.ref == 'refs/heads/master' && ( github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' ) permissions: contents: read packages: write @@ -44,23 +45,19 @@ jobs: uses: docker/setup-buildx-action@v3 with: install: true - - - name: Build Docker image - uses: docker/build-push-action@v6 - with: - push: false - pull: true - no-cache: true - context: ./docker/ - file: ./docker/Dockerfile.${{ matrix.images }} - tags: "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}" - + - name: Log in to the Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Push to Docker Hub - if: github.ref == 'refs/heads/master' && ( github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' ) - run: docker push "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}" + - name: Build Docker image + uses: docker/build-push-action@v6 + with: + push: ${{ env.DEPLOY }} + pull: true + no-cache: true + context: ./docker/ + file: ./docker/Dockerfile.${{ matrix.images }} + tags: "${{ env.ABSOLUTE_DH_IMAGE }}:${{ matrix.images }}"