Skip to content

Update matrix-commander.mdx #1398

Update matrix-commander.mdx

Update matrix-commander.mdx #1398

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