From d2a388da9e5abccce258806ecd072de76fca5378 Mon Sep 17 00:00:00 2001 From: monosans Date: Tue, 15 Apr 2025 14:16:09 +0300 Subject: [PATCH] refactor docker ci --- .github/workflows/ci.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e9367e..860f08d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,8 +254,6 @@ jobs: if-no-files-found: error build-docker: runs-on: ubuntu-24.04 - env: - PLATFORMS: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x permissions: attestations: write id-token: write @@ -269,19 +267,23 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=raw,value=${{ github.sha }} - uses: docker/setup-qemu-action@v3 - with: - platforms: ${{ env.PLATFORMS }} - uses: docker/setup-buildx-action@v3 - with: - platforms: ${{ env.PLATFORMS }} - id: push uses: docker/build-push-action@v6 with: - platforms: ${{ env.PLATFORMS }} + cache-from: type=gha + cache-to: type=gha,mode=max + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x push: true - tags: | - ghcr.io/monosans/proxy-scraper-checker:${{ github.sha }} + tags: ${{ steps.meta.outputs.tags }} - uses: actions/attest-build-provenance@v2 with: subject-digest: ${{ steps.push.outputs.digest }} @@ -295,7 +297,7 @@ jobs: run: | echo "# syntax=docker.io/docker/dockerfile:1 - FROM ghcr.io/monosans/proxy-scraper-checker:${{ github.sha }} + FROM ghcr.io/${{ github.repository }}:${{ github.sha }} ARG \\ UID=1000 \\ @@ -320,7 +322,8 @@ jobs: if: ${{ always() && github.event_name == 'pull_request' }} needs: - build - - build-docker + # Too slow + # - build-docker - clippy - pre-commit - rustfmt