forked from dylan-sutton-chavez/edge-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
62 lines (55 loc) · 1.61 KB
/
action.yml
File metadata and controls
62 lines (55 loc) · 1.61 KB
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
name: Docs
description: Nextra static export. build = next build + upload docs/out; deploy = pull artifact + push to edge-python-docs.
inputs:
mode:
description: "build | deploy"
required: true
cloudflare-api-token:
description: Cloudflare API token (deploy only).
required: false
default: ""
cloudflare-account-id:
description: Cloudflare account id (deploy only).
required: false
default: ""
runs:
using: composite
steps:
- name: Setup Node
if: inputs.mode == 'build'
uses: actions/setup-node@v6
with:
node-version: "22"
cache: npm
cache-dependency-path: docs/package-lock.json
# Reproducible install from the committed lockfile.
- name: Install
if: inputs.mode == 'build'
shell: bash
working-directory: docs
run: npm ci
- name: Build
if: inputs.mode == 'build'
shell: bash
working-directory: docs
run: npm run build
- name: Upload static export
if: inputs.mode == 'build'
uses: actions/upload-artifact@v6
with:
name: docs-out
path: docs/out
retention-days: 1
- name: Download static export
if: inputs.mode == 'deploy'
uses: actions/download-artifact@v8
with:
name: docs-out
path: docs/out
- name: Deploy to Cloudflare Pages
if: inputs.mode == 'deploy'
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ inputs.cloudflare-api-token }}
accountId: ${{ inputs.cloudflare-account-id }}
command: pages deploy docs/out --project-name=edge-python-docs --branch=main