-
Notifications
You must be signed in to change notification settings - Fork 26
87 lines (78 loc) · 2.44 KB
/
docs_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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Docs Deploy
on:
push:
branches: [main]
paths:
- '.github/workflows/docs_deploy.yaml'
- 'docs/**'
- 'samples/**'
workflow_dispatch:
inputs:
target:
type: choice
description: 'Environment'
required: true
options:
- development
- production
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: docs
cancel-in-progress: false
jobs:
docs:
name: Deploy Docs
runs-on: ubuntu-latest
environment: ${{ (startsWith(github.ref, 'refs/tags/forui') || inputs.target == 'production') && 'docs-production' || 'docs-development' }}
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/configure-pages@v4
- run: pnpm install
- run: NEXT_PUBLIC_DEMO_URL=${{ vars.DEMO_URL }} pnpm run export
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_DOCS_PROJECT_NAME }}
directory: ./docs/out
samples:
name: Deploy Samples
runs-on: ubuntu-latest
environment: ${{ (startsWith(github.ref, 'refs/tags/forui') || inputs.target == 'production') && 'docs-production' || 'docs-development' }}
defaults:
run:
working-directory: ./samples
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: subosito/[email protected]
with:
cache: true
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- run: flutter build web
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_DEMO_PROJECT_NAME }}
directory: ./samples/build/web