mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
refactor: Update GitHub Actions workflow for PR preview deployments
This commit is contained in:
35
.github/workflows/deploy.yml
vendored
35
.github/workflows/deploy.yml
vendored
@@ -1,29 +1,30 @@
|
|||||||
name: PR Preview Static Files
|
name: Deploy PR previews
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened]
|
types:
|
||||||
branches:
|
- opened
|
||||||
- main
|
- reopened
|
||||||
|
- synchronize
|
||||||
|
- closed
|
||||||
|
|
||||||
|
concurrency: preview-${{ github.ref }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-preview:
|
deploy-preview:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout PR branch
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Deploy preview to gh-pages (pr-<NUM>)
|
# Si no tienes build, solo copia los archivos
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
- name: Prepare static preview folder
|
||||||
with:
|
run: |
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
mkdir -p preview
|
||||||
publish_dir: ./ # 👈 O solo blueprints/ si prefieres
|
cp meta.json preview/
|
||||||
destination_dir: pr-${{ github.event.pull_request.number }}
|
cp -r blueprints preview/
|
||||||
|
|
||||||
- name: Comment PR with Preview URL
|
# Despliega el preview usando el action
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
- uses: rossjrw/pr-preview-action@v1
|
||||||
with:
|
with:
|
||||||
message: |
|
source-dir: preview
|
||||||
🚀 PR Preview deployed!
|
|
||||||
👉 [View it here](https://dokploy.github.io/templates/pr-${{ github.event.pull_request.number }}/)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user