add github actions deploy-pr

This commit is contained in:
Apteryx-nz 2026-06-24 23:01:44 +09:00
parent b9e0990d21
commit 28f2ef1e14

43
.github/workflows/deploy-pr.yml vendored Normal file
View File

@ -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 }}