69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
name: "Spec"
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
pull_request:
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
build-openapi:
|
||
name: "🐍 Build OpenAPI definitions"
|
||
runs-on: ubuntu-latest
|
||
container: "python:3.9"
|
||
steps:
|
||
- name: "📥 Source checkout"
|
||
uses: actions/checkout@v2
|
||
- name: "📦 Asset creation"
|
||
run: |
|
||
python3 -m venv env && . env/bin/activate
|
||
pip install -r scripts/requirements.txt
|
||
scripts/generate-matrix-org-assets
|
||
- name: "📤 Artifact upload"
|
||
uses: actions/upload-artifact@v2
|
||
with:
|
||
name: openapi-artifact
|
||
path: assets.tar.gz
|
||
|
||
build-spec:
|
||
name: "📖 Build the spec"
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: "➕ Setup Node"
|
||
uses: actions/setup-node@v2
|
||
with:
|
||
node-version: '14'
|
||
- name: "➕ Setup Hugo"
|
||
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6
|
||
with:
|
||
hugo-version: '0.85.0'
|
||
extended: true
|
||
- name: "📥 Source checkout"
|
||
uses: actions/checkout@v2
|
||
with:
|
||
submodules: 'recursive'
|
||
- name: "⚙️ npm"
|
||
run: |
|
||
npm i
|
||
npm run get-proposals
|
||
|
||
# for PRs, set the baseURL to `/`. Otherwise, set it to `/unstable`.
|
||
- name: "⚙️ Calculate baseURL"
|
||
id: set-baseurl
|
||
run: |
|
||
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
||
echo ::set-output name=baseURL::/
|
||
else
|
||
echo ::set-output name=baseURL::/unstable
|
||
fi
|
||
|
||
- name: "⚙️ hugo"
|
||
run: hugo --baseURL "${{ steps.set-baseurl.outputs.baseURL }}" -d "spec"
|
||
- name: "📦 Tarball creation"
|
||
run: tar -czf spec.tar.gz spec
|
||
- name: "📤 Artifact upload"
|
||
uses: actions/upload-artifact@v2
|
||
with:
|
||
name: spec-artifact
|
||
path: spec.tar.gz
|