From 26e65e8a20281a4c0f2a520563b41c7d3df52532 Mon Sep 17 00:00:00 2001 From: Archimedes Trajano Date: Sat, 12 Jul 2025 10:24:06 -0400 Subject: [PATCH] PR build --- .github/workflows/pr.yml | 76 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..e86c769f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,76 @@ +name: Publish Docker image for PR + +on: + pull_request: + branches: + - "**" + +jobs: + apache: + name: Apache + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into registry ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/trajano/nextcloud + tags: | + type=ref,event=pr,suffix=-apache + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: 31/apache + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + fpm: + name: FPM + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log into registry ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/trajano/nextcloud + tags: | + type=ref,event=pr,suffix=-fpm + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: 31/fpm + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max