Skip to content

Commit 2b9881e

Browse files
committed
feat: add GitHub workflows for deploying documentation previews to Cloudflare Pages
1 parent ed9f71d commit 2b9881e

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy Documentation Preview
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
comment:
7+
description: 'Deployment Documentation'
8+
required: false
9+
default: 'Manual preview deployment'
10+
11+
jobs:
12+
build-and-deploy:
13+
if: github.ref == 'refs/heads/main'
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
deployments: write
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
29+
- name: Install dependencies
30+
run: |
31+
npm install
32+
33+
- name: Build frontend
34+
run: npm run build
35+
36+
- name: Deploy to Cloudflare Pages
37+
uses: cloudflare/wrangler-action@v3
38+
with:
39+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+
command: pages deploy out --project-name=deploystack-docs --branch=main
42+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy_prod.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy Documentation Preview
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
comment:
7+
description: 'Deployment Documentation'
8+
required: false
9+
default: 'Manual preview deployment'
10+
11+
jobs:
12+
build-and-deploy:
13+
if: github.ref == 'refs/heads/prod'
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
deployments: write
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
29+
- name: Install dependencies
30+
run: |
31+
npm install
32+
33+
- name: Build frontend
34+
run: npm run build
35+
36+
- name: Deploy to Cloudflare Pages
37+
uses: cloudflare/wrangler-action@v3
38+
with:
39+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+
command: pages deploy out --project-name=deploystack-docs --branch=prod
42+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)