-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (83 loc) · 2.64 KB
/
build-and-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
name: Build and Deploy
on:
push:
branches:
- master
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Runs at midnight UTC every day
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v4
with:
path: mdn-graph
- name: Checkout mdn/yari repo
uses: actions/checkout@v4
with:
repository: mdn/yari
path: yari
- name: Checkout mdn/content repo
uses: actions/checkout@v4
with:
repository: mdn/content
path: content
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies for mdn/yari
run: |
# Don't remove lock for now, Yari code is often bad and doesn't work
# with latest dependencies
# rm yarn.lock
yarn install
working-directory: ./yari
- name: Install dependencies for mdn/content
run: |
rm yarn.lock
yarn install
working-directory: ./content
- name: Install dependencies for this repo
run: |
bun install
bun update @mdn/browser-compat-data
working-directory: ./mdn-graph
- name: Build mdn/content
run: |
echo "CONTENT_ROOT=../content/files" > .env
yarn build:prepare
yarn build --nohtml
working-directory: ./yari
- name: Build MDN graph
run: bun run build-graph
working-directory: ./mdn-graph
env:
BUILT_CONTENT_ROOT: ../yari/client/build
- name: Generate warning report
run: bun run build-warnings
working-directory: ./mdn-graph
- name: Determine commit message
id: commit-message
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "message=Manual update by ${{ github.actor }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "schedule" ]; then
echo "message=Scheduled update" >> $GITHUB_ENV
else
echo "message=Update based on ${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./mdn-graph/docs
publish_branch: gh-pages
commit_message: ${{ env.message }}
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
enable_jekyll: true