Files
templates/.github/workflows/deploy-preview.yml
Mauricio Siu 7e9dda562b chore: update GitHub Actions workflows for improved artifact handling and debugging
- Added an ID to the artifact upload step for better tracking.
- Enhanced the verification step to include workflow and repository information.
- Updated permissions to allow writing actions in the deploy workflow.
- Added debug information to the deploy workflow for better visibility of event details.
2025-03-16 11:12:45 -06:00

52 lines
1.5 KiB
YAML

name: Upload Preview Deployment
on:
workflow_run:
workflows: ['Build Preview Deployment']
types:
- completed
permissions:
actions: write
deployments: write
contents: read
pull-requests: write
jobs:
deploy-preview:
runs-on: ubuntu-latest
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository
name: Deploy Preview to Cloudflare Pages
steps:
- name: Debug Info
env:
EVENT_JSON: ${{ toJSON(github.event) }}
run: |
echo "Workflow Run ID: ${{ github.event.workflow_run.id }}"
echo "Event Type: ${{ github.event.workflow_run.event }}"
echo "Repository: ${{ github.event.workflow_run.head_repository.full_name }}"
echo "Full Event: $EVENT_JSON"
- name: Download artifacts
uses: dawidd6/action-download-artifact@v3
with:
workflow: Build Preview Deployment
run_id: ${{ github.event.workflow_run.id }}
name: preview-build
path: build
search_artifacts: true
- 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