-
Notifications
You must be signed in to change notification settings - Fork 28
63 lines (62 loc) · 1.92 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-22.04
env:
ImageOS: ubuntu22
steps:
- uses: actions/checkout@v2
# Maintain timestamps of previously published files
- uses: actions/checkout@v2
with:
ref: static
path: _site
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.4'
- uses: denoland/setup-deno@v1
with:
deno-version: "1.34.0"
# Jekyll 4 fails to create the .jekyll-cache directory, but if we pre-create it, it works
- run: mkdir -p .jekyll-cache
- run: bundler install --deployment && bundler exec jekyll build
- run: npm i
working-directory: ./scripts
- run: npm run check
working-directory: ./scripts
- run: npm run build
working-directory: ./scripts
- run: npm run buildLib
working-directory: ./scripts
- run: make build
working-directory: ./cli
- run: rm -rf ./_site/cli && cp ./cli/bundled.ts ./_site/cli
# Upload the static content as a workflow artifact when not publishing the site (non-main branches)
- name: Archive site
uses: actions/upload-artifact@v4
with:
name: site
path: _site
retention-days: 2
# Separate job so it doesn't run inside the jekyll container
publish:
needs: build
runs-on: ubuntu-22.04
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
steps:
- uses: actions/download-artifact@v4
with:
name: site
path: _site
# Publish to GH pages on main branch
- name: Push to GH pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: static
FOLDER: _site
CLEAN: true