mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
- 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.
52 lines
1.5 KiB
YAML
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 |