From 28f2ef1e14db2ef84c189aa6feaa84830427b0a0 Mon Sep 17 00:00:00 2001 From: Apteryx-nz Date: Wed, 24 Jun 2026 23:01:44 +0900 Subject: [PATCH] add github actions deploy-pr --- .github/workflows/deploy-pr.yml | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy-pr.yml diff --git a/.github/workflows/deploy-pr.yml b/.github/workflows/deploy-pr.yml new file mode 100644 index 0000000..fe14031 --- /dev/null +++ b/.github/workflows/deploy-pr.yml @@ -0,0 +1,43 @@ +name: deploy-pr + +on: + pull_request: + paths: + - 'app/**' + - .github/workflows/deploy-pr.yml + +env: + REGISTRY: ghcr.io + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr + type=sha + + - name: Log in to GitHub container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./app + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}