diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76c8f23e..cb6f2193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,26 +126,24 @@ jobs: - ruby - openapi - frontend + if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'release-please--') runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - + - uses: docker/setup-buildx-action@v4 - name: Build Docker smoke image - run: docker build -t html2rss/web -f Dockerfile . - - - name: Export Docker smoke image - run: docker save html2rss/web -o /tmp/html2rss-web-smoke-image.tar - - - name: Upload Docker smoke image - uses: actions/upload-artifact@v7 + uses: docker/build-push-action@v7 with: - name: docker-smoke-image - path: /tmp/html2rss-web-smoke-image.tar - retention-days: 1 + context: . + load: true + tags: html2rss/web + cache-from: type=gha + cache-to: type=gha,mode=max docker-test: needs: - docker-build-smoke-image + if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'release-please--') runs-on: ubuntu-latest strategy: fail-fast: false @@ -158,14 +156,15 @@ jobs: with: bundler-cache: true - - name: Download Docker smoke image - uses: actions/download-artifact@v8 - with: - name: docker-smoke-image - path: /tmp + - uses: docker/setup-buildx-action@v4 - - name: Load Docker smoke image - run: docker load -i /tmp/html2rss-web-smoke-image.tar + - name: Load Docker smoke image from cache + uses: docker/build-push-action@v7 + with: + context: . + load: true + tags: html2rss/web + cache-from: type=gha - name: Run Docker smoke test env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a944c296..1678884d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,14 +154,6 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - name: Build and push Docker image uses: docker/build-push-action@v7 env: @@ -174,8 +166,8 @@ jobs: BUILD_TAG=${{ env.RELEASE_VERSION }} GIT_SHA=${{ needs.guard.outputs.target_sha }} platforms: linux/amd64,linux/arm64 - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache-new + cache-from: type=gha + cache-to: type=gha,mode=max provenance: true sbom: true labels: | @@ -188,11 +180,6 @@ jobs: org.opencontainers.image.url=https://github.com/${{ github.repository }}/releases/tag/${{ env.RELEASE_TAG }} org.opencontainers.image.version=${{ env.RELEASE_VERSION }} - - name: Move updated cache into place - run: | - rm -rf /tmp/.buildx-cache - mv /tmp/.buildx-cache-new /tmp/.buildx-cache - - name: Summarize published image tags run: | {