From cd1165bcdd5092eb913c1d83f484bbdaf515e3bd Mon Sep 17 00:00:00 2001 From: kurochan Date: Fri, 19 Jan 2024 05:51:12 +0900 Subject: [PATCH] add distribute workflow --- .github/workflows/distribute.yml | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/distribute.yml diff --git a/.github/workflows/distribute.yml b/.github/workflows/distribute.yml new file mode 100644 index 0000000..d02cc0c --- /dev/null +++ b/.github/workflows/distribute.yml @@ -0,0 +1,50 @@ +name: distribute + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + variant: [bookworm-jpg-png] + timeout-minutes: 50 + steps: + - uses: actions/checkout@v4 + + - name: Determine version + run: echo "VERSION=$(git describe --tags --match "v*" --always --abbrev=7)" >> $GITHUB_ENV + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Packages + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build container image + uses: docker/build-push-action@v5 + with: + context: . + provenance: false + push: false + # TODO + # platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 + file: Dockerfile.${{ matrix.variant }} + tags: ghcr.io/CyberAgentAI/libvips:${{ env.VERSION }} + +concurrency: + group: pr-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true