name: Upload Preview Deployment on: workflow_run: workflows: - "Build Preview Deployment" types: - completed permissions: actions: write deployments: write contents: read pull-requests: write jobs: on-success: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Debug Event run: | echo "Event name: ${{ github.event_name }}" echo "Workflow name: ${{ github.event.workflow.name }}" echo "Workflow run id: ${{ github.event.workflow_run.id }}" echo "Workflow run number: ${{ github.event.workflow_run.run_number }}" echo "Workflow run conclusion: ${{ github.event.workflow_run.conclusion }}" echo "Workflow run event: ${{ github.event.workflow_run.event }}" deploy-preview: needs: on-success runs-on: ubuntu-latest name: Deploy Preview to Cloudflare Pages steps: - name: Download artifacts uses: actions/download-artifact@v4 with: name: preview-build path: build github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - name: List files run: ls -la build - 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: build