Update matrix-commander.mdx #1398
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |