-
-
Notifications
You must be signed in to change notification settings - Fork 73
64 lines (58 loc) · 2.03 KB
/
cd-preview-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: CD - Preview Deploy
on:
workflow_run:
workflows: [CD - Preview Build]
types:
- completed
permissions:
actions: read
deployments: write
contents: read
pull-requests: write
jobs:
deploy-app-preview:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Deploy app preview
steps:
- name: Download app build artifact
uses: actions/download-artifact@v4
id: preview-app-build-artifact
with:
name: preview-app-build
path: build
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Deploy preview app 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: enclosed
deploymentName: Preview App
directory: ${{ steps.preview-app-build-artifact.outputs.download-path }}
wranglerVersion: '3'
deploy-docs-preview:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Deploy docs preview
steps:
- name: Download docs build artifact
uses: actions/download-artifact@v4
id: preview-docs-build-artifact
with:
name: preview-docs-build
path: build
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Deploy preview docs 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: enclosed-docs
deploymentName: Preview Docs
directory: ${{ steps.preview-docs-build-artifact.outputs.download-path }}
wranglerVersion: '3'