-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (101 loc) · 2.71 KB
/
build_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
99
100
101
102
103
104
105
106
107
108
109
name: build_deploy
on:
push:
branches: master
pull_request:
repository_dispatch:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
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: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
#
# For each document category (admin, standards, etc.),
# build using `metanorma site generate`.
#
# At the very end, integrate them all with Jekyll.
#
# NOTE: Try to parallelize the build process as much as possible.
# This is currently done by building the admin and standards docs in
# parallel.
#
build-admin:
name: Build admin docs
needs: build-site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: |
make build-admin
build-standards:
name: Build standards docs
needs: build-site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: |
make build-standards
build-site:
name: Build site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
JEKYLL: 1
- name: Build site
run: |
make _site
upload-artifact:
name: Upload pages artifact
needs: [build-site, build-admin, build-standards]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
# needs: [build-admin, build-standards]
needs: upload-artifact
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4