-
Notifications
You must be signed in to change notification settings - Fork 130
75 lines (73 loc) · 2.67 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
name: Deploy
on:
workflow_dispatch: {}
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
id-token: write
packages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache-dependency-path: |
yarn.lock
'examples/*/yarn.lock'
- run: yarn --frozen-lockfile
- run: yarn build
- name: Build example "api"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/api
- name: Build example "chess"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/chess
- name: Build example "eia"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/eia
env:
EIA_KEY: ${{ secrets.EIA_KEY }}
- name: Build example "google-analytics"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/google-analytics
env:
GA_PROPERTY_ID: ${{ vars.GA_PROPERTY_ID }}
GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }}
GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }}
- name: Build example "hello-world"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/hello-world
- name: Build example "mortgage-rates"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/mortgage-rates
- name: Build example "penguin-classification"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
yarn --frozen-lockfile && yarn build
working-directory: examples/penguin-classification
- name: Build example "plot"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/plot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir dist/examples && for i in examples/*; do if [ -d $i/dist ]; then mv -v $i/dist dist/examples/$(basename $i); fi; done
- uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: framework-pages
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
# TODO: This doesn't include the examples. How can we fix that?
# TODO: Re-enable deploy to Observable
# - name: Deploy to Observable
# run: yarn deploy -m "$(git log -1 --pretty=%s)"
# env:
# OBSERVABLE_TOKEN: ${{ secrets.OBSERVABLE_API_TOKEN }}