mirror of
https://github.com/actions/checkout.git
synced 2026-06-28 08:45:23 +00:00
add github actions deploy-pr
This commit is contained in:
parent
b9e0990d21
commit
28f2ef1e14
43
.github/workflows/deploy-pr.yml
vendored
Normal file
43
.github/workflows/deploy-pr.yml
vendored
Normal 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 }}
|
||||
Loading…
Reference in New Issue
Block a user