From e3bec677ea1dea8f6792d2dd1cacdb22c4f82b77 Mon Sep 17 00:00:00 2001 From: monosans Date: Tue, 15 Apr 2025 12:59:20 +0300 Subject: [PATCH] ci: prebuild docker images --- .github/workflows/ci.yml | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40dff1a..5083dbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,6 +252,65 @@ jobs: name: proxy-scraper-checker-${{ matrix.target }} path: dist/ if-no-files-found: error + build-docker: + if: ${{ github.event_name != 'pull_request' }} + runs-on: ubuntu-24.04 + permissions: + attestations: write + id-token: write + # packages: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - id: push + uses: docker/build-push-action@v6 + with: + platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x + push: true + tags: | + monosans/proxy-scraper-checker:latest + monosans/proxy-scraper-checker:${{ github.sha }} + - uses: actions/attest-build-provenance@v2 + with: + subject-digest: ${{ steps.push.outputs.digest }} + subject-name: ghcr.io/${{ github.repository }} + push-to-registry: true + - run: mkdir -p dist + - run: echo -n '${{ github.sha }}' > dist/commit-sha.txt + - run: mv compose.yaml dist/ + - run: mv config.toml dist/ + - run: | + echo "# syntax=docker.io/docker/dockerfile:1 + + FROM ghcr.io/monosans/proxy-scraper-checker:${{ github.sha }} + + ARG \\ + UID=1000 \\ + GID=1000 + + USER root + + RUN groupmod --gid \"${GID}\" app \\ + && usermod --uid \"${UID}\" --gid \"${GID}\" app + + USER app + " > dist/Dockerfile + - uses: actions/attest-build-provenance@v2 + with: + subject-path: dist + - uses: actions/upload-artifact@v4 + with: + name: proxy-scraper-checker-docker + path: dist/ + if-no-files-found: error check: if: ${{ always() && github.event_name == 'pull_request' }} needs: