-
Notifications
You must be signed in to change notification settings - Fork 358
144 lines (139 loc) Β· 4.88 KB
/
build-matrix.org.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: "π Build the matrix.org website"
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
# only allow one build per PR: cancel any existing ones.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Apply styling to the spec documents.
# This step also sets up the OpenAPI UI.
build-spec:
name: "π Legacy spec"
runs-on: ubuntu-latest
steps:
- name: "π₯ Source checkout"
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: "π Update docs"
run: |
scripts/update_docs.sh
- name: "βοΈ Create output directory for Sass"
run: mkdir -p content/docs/css
- name: "π§ Transform Sass"
uses: gha-utilities/sass-build@04542d49f28015d06d2a06f3b48bf72bfa76a6b3
with:
source: legacy-spec/scss/main.scss
destination: content/docs/css/main.css
- name: "π¦ Tarball creation"
run: tar -czf styled-docs.tar.gz content/docs
- name: "π€ Artifact upload"
uses: actions/upload-artifact@v2
with:
name: styled-docs-artifact
path: styled-docs.tar.gz
# Run gatsby.
build-gatsby:
name: "π Gatsby"
runs-on: ubuntu-latest
steps:
- name: "π₯ Source checkout"
uses: actions/checkout@v2
- name: "βοΈ Setup node"
uses: actions/setup-node@v2
with:
node-version: '14'
- name: "π Gatsby dependencies cache"
uses: actions/cache@v2
with:
path: |
gatsby/node_modules
key: ${{ runner.os }}-gatsby-deps-${{ hashFiles('gatsby/package-lock.json') }}
- name: "βοΈ Install Gatsby"
run: npm install
working-directory: gatsby
- name: "π Gatsby build cache"
uses: actions/cache@v2
with:
path: |
gatsby/public
gatsby/.cache
key: ${{ runner.os}}-gatsby-build-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-gatsby-build-
- name: "π§ Gatsby build"
run: npm run build
working-directory: gatsby
env:
GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES: true
CI: true
- name: "π¦ Tarball creation"
run: tar -czf gatsby-site.tar.gz public
working-directory: gatsby
- name: "π€ Artifact upload"
uses: actions/upload-artifact@v2
with:
name: gatsby-artifact
path: gatsby/gatsby-site.tar.gz
build-guides:
name: "π Implementation guides"
runs-on: ubuntu-latest
container:
image: "buildpack-deps"
steps:
- name: "π₯ Source checkout"
uses: actions/checkout@v2
- name: "π§ Build implementation guides"
run: |
wget https://github.com/rust-lang/mdBook/releases/download/v0.4.1/mdbook-v0.4.1-x86_64-unknown-linux-gnu.tar.gz
tar -xf mdbook-v0.4.1-x86_64-unknown-linux-gnu.tar.gz
./mdbook build server -d ${GITHUB_WORKSPACE}/implementation-guides/implementation-guides/server
./mdbook build client -d ${GITHUB_WORKSPACE}/implementation-guides/implementation-guides/client
./mdbook build application-services -d ${GITHUB_WORKSPACE}/implementation-guides/implementation-guides/application-services
cp index.html ./implementation-guides/
working-directory: implementation-guides
- name: "π¦ Tarball creation"
run: tar -czf implementation-guides.tar.gz implementation-guides
working-directory: implementation-guides
- name: "π€ Artifact upload"
uses: actions/upload-artifact@v2
with:
name: guides-artifact
path: implementation-guides/implementation-guides.tar.gz
# Merge the three sets of outputs together, together
# with the existing static stuff in `content`.
package:
name: "π¦ Package"
runs-on: ubuntu-latest
needs: [build-spec, build-gatsby, build-guides]
steps:
- name: "π₯ Source checkout"
uses: actions/checkout@v2
- name: "π₯ Spec artifact download"
uses: actions/download-artifact@v2
with:
name: styled-docs-artifact
- name: "π₯ Gatsby artifact download"
uses: actions/download-artifact@v2
with:
name: gatsby-artifact
- name: "π₯ Implementation guides artifact download"
uses: actions/download-artifact@v2
with:
name: guides-artifact
- name: "π¦ Merge archives"
run: |
tar -xzvf styled-docs.tar.gz
tar -C content --strip-components=1 -xzf gatsby-site.tar.gz
tar -C content -xzf implementation-guides.tar.gz
tar -czf content.tar.gz content
- name: "π€ Artifact upload"
uses: actions/upload-artifact@v2
with:
name: merged-content-artifact
path: content.tar.gz