From 9111332760438af7e658a2d8da2f99b0e24af0d7 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 9 Mar 2025 22:11:37 -0600 Subject: [PATCH] feat: Add GitHub Actions workflow for PR preview deployments --- .github/workflows/deploy.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..e7961f35 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,29 @@ +name: PR Preview Static Files + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + +jobs: + deploy-preview: + runs-on: ubuntu-latest + + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Deploy preview to gh-pages (pr-) + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./ # 👈 O solo blueprints/ si prefieres + destination_dir: pr-${{ github.event.pull_request.number }} + + - name: Comment PR with Preview URL + uses: marocchino/sticky-pull-request-comment@v2 + with: + message: | + 🚀 PR Preview deployed! + 👉 [View it here](https://.github.io//pr-${{ github.event.pull_request.number }}/)