Skip to content

Commit 89b0ad8

Browse files
authored
Port CI to Github Actions (#3363)
This is intended to replace the existing Buildkite one, but the latter can be removed at a later point when all the bits are in place.
1 parent cbe3081 commit 89b0ad8

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/main.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Spec"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-openapi:
11+
name: "🐍 Build OpenAPI definitions for matrix.org"
12+
runs-on: ubuntu-latest
13+
container: "python:3.9"
14+
steps:
15+
- name: "📥 Source checkout"
16+
uses: actions/checkout@v2
17+
- name: "📦 Asset creation"
18+
run: |
19+
python3 -m venv env && . env/bin/activate
20+
pip install -r scripts/requirements.txt
21+
scripts/generate-matrix-org-assets
22+
- name: "📤 Artifact upload"
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: openapi-artifact
26+
path: assets.tar.gz
27+
28+
build-spec:
29+
name: "📖 Build the spec"
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: "➕ Setup Node"
33+
uses: actions/setup-node@v2
34+
with:
35+
node-version: '14'
36+
- name: "➕ Setup Hugo"
37+
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6
38+
with:
39+
hugo-version: '0.85.0'
40+
extended: true
41+
- name: "📥 Source checkout"
42+
uses: actions/checkout@v2
43+
with:
44+
submodules: 'recursive'
45+
- name: "⚙️ npm"
46+
run: |
47+
npm i
48+
npm run get-proposals
49+
- name: "⚙️ hugo"
50+
run: hugo --baseURL "/unstable" -d "spec"
51+
- name: "📦 Tarball creation"
52+
run: tar -czf spec.tar.gz spec
53+
- name: "📤 Artifact upload"
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: spec-artifact
57+
path: spec.tar.gz
58+
59+
rebuild-matrixdotorg:
60+
name: "👷 Rebuild matrix.org"
61+
needs: build-openapi
62+
runs-on: ubuntu-latest
63+
if: ${{ false && github.event_name == 'push' && github.ref == 'refs/head/main' }}
64+
steps:
65+
- name: "🪄 Triggering rebuild of matrix.org"
66+
run: |
67+
curl -XPOST -u "${{secrets.TRIGGER_MATRIXORG_REBUILD_TOKEN}}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/${{ github.repository_owner }}/matrix.org/actions/workflows/build-matrix.org.yml/dispatches --data '{"ref": "${{ github.ref }}" }'

0 commit comments

Comments
 (0)