-
-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (98 loc) · 3.15 KB
/
deploy.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Deploy
on:
push:
paths:
- 'examples/cloudflare-webhook/**'
- 'docs/**'
- 'apps/worker-docs/**'
- '.github/workflows/deploy.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
examples:
name: Deploy examples
runs-on: ubuntu-latest
if: github.ref_name == 'main' && github.ref_type == 'branch'
strategy:
matrix:
node-version:
- 20.x
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm install
- name: Run tsc
run: npm run prestart
- name: Run build
run: npm run build
- name: Install example dependencies
run: npm install
working-directory: ./examples/cloudflare-webhook/
- name: Deploy cloudflare-webhook
uses: cloudflare/wrangler-action@v3.6.0
env:
DISCORD_WEBHOOK_URL: ${{ secrets.CW_DISCORD_WEBHOOK_URL }}
HTML_MD_KEY: ${{ secrets.CW_HTML_MD_KEY }}
PATREON_WEBHOOK_SECRET: ${{ secrets.CW_PATREON_WEBHOOK_SECRET }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: ./examples/cloudflare-webhook/
secrets: |
HTML_MD_KEY
PATREON_WEBHOOK_SECRET
DISCORD_WEBHOOK_URL
docs:
name: Deploy documentation
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
strategy:
matrix:
node-version:
- 20.x
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm install
- name: Run tsc
run: npm run prestart
- name: Run build
run: npm run build
- name: Install dependencies
run: npm install
working-directory: docs
- name: Build documentation
run: npm run docs:build
working-directory: docs
- name: Install wrangler
run: npm i -D wrangler --legacy-peer-deps
- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3.6.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy docs/.vitepress/dist --project-name=patreon-api --commit-dirty=true
- name: Install worker dependencies
run: npm install
working-directory: ./apps/worker-docs
- name: Deploy patreon-docs worker
uses: cloudflare/wrangler-action@v3.6.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy -c ./apps/worker-docs/wrangler.toml