mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
- Updated workflow trigger to use a list format for better readability. - Separated the deploy preview job into distinct steps for improved organization. - Enhanced debug information to provide more detailed event context. - Updated artifact download action to the latest version for better performance.
54 lines
1.6 KiB
YAML
54 lines
1.6 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:
|
|
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 |