mirror of
https://github.com/Dokploy/templates
synced 2025-06-26 18:16:07 +00:00
- Added permissions for reading contents, actions, and writing pull requests. - Set artifact retention period to 1 day for the preview build.
42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: Upload Preview Deployment
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ['Build Preview Deployment']
|
|
types:
|
|
- completed
|
|
branches-ignore:
|
|
- main
|
|
|
|
permissions:
|
|
actions: read
|
|
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.event == 'pull_request'
|
|
name: Deploy Preview to Cloudflare Pages
|
|
steps:
|
|
- name: Download artifact
|
|
uses: dawidd6/action-download-artifact@v3
|
|
with:
|
|
workflow: build-preview.yml
|
|
name: preview-build
|
|
path: build
|
|
run_id: ${{ github.event.workflow_run.id }}
|
|
if_no_artifact_found: error
|
|
|
|
- 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 |