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