diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 75e07692e8..07147fec93 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -21,9 +21,11 @@ jobs: steps: - name: Check out repository + if: github.event_name != 'workflow_dispatch' uses: actions/checkout@v2 - name: Set build platforms + if: github.event_name != 'workflow_dispatch' id: platform run: | GITHUB_REF="${{ github.ref }}" @@ -41,6 +43,7 @@ jobs: fi - name: Docker meta + if: github.event_name != 'workflow_dispatch' id: meta uses: docker/metadata-action@v3 with: @@ -61,17 +64,10 @@ jobs: org.opencontainers.image.vendor=Some Engineering Inc. - name: Set up Docker Buildx + if: github.event_name != 'workflow_dispatch' id: buildx uses: docker/setup-buildx-action@v1 - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-buildx- - - name: Log in to Docker Hub if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -80,7 +76,7 @@ jobs: password: ${{ secrets.DOCKERHUB_PASS }} - name: Log in to GitHub Container Registry - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' uses: docker/login-action@v1 with: registry: ghcr.io @@ -88,6 +84,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image + if: github.event_name != 'workflow_dispatch' uses: docker/build-push-action@v2 with: context: . @@ -100,13 +97,6 @@ jobs: TESTS=false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new - - - name: Move cache - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache split-build: name: Build split Docker images