From 67798563406221270c84054b053cb87e1d0bc0c3 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 16 Mar 2025 11:17:03 -0600 Subject: [PATCH] chore: update build preview workflow to include deployment step - Renamed job to "Build and Deploy Preview" for clarity. - Added a deployment step to Cloudflare Pages with necessary configurations. - Updated permissions to include deployment rights. --- .github/workflows/build-preview.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-preview.yml b/.github/workflows/build-preview.yml index 4aa110ac..537c9587 100644 --- a/.github/workflows/build-preview.yml +++ b/.github/workflows/build-preview.yml @@ -1,17 +1,18 @@ -name: "Build Preview Deployment" +name: "Build and Deploy Preview" on: pull_request: types: [opened, synchronize] jobs: - build-preview: + build-and-deploy: runs-on: ubuntu-latest - name: Build Preview Site and Upload Build Artifact + name: Build and Deploy Preview permissions: contents: read actions: write pull-requests: write + deployments: write steps: - name: Checkout uses: actions/checkout@v4 @@ -37,6 +38,16 @@ jobs: - name: List build output run: ls -la app/dist + - name: Deploy to Cloudflare Pages + uses: AdrianGonz97/refined-cf-pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + githubToken: ${{ secrets.GITHUB_TOKEN }} + projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} + deploymentName: Preview + directory: app/dist + - name: Upload build artifact id: upload-artifact uses: actions/upload-artifact@v4