Skip to content

Revamp build process #28

Revamp build process

Revamp build process #28

Workflow file for this run

name: build_deploy
on:
push:
branches: master
pull_request:
repository_dispatch:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
#
# For each document category (admin, standards, etc.),
# build using `metanorma site generate`.
#
# At the very end, integrate them all with Jekyll.
#
# NOTE: Try to parallelize the build process as much as possible.
# This is currently done by building the admin and standards docs in
# parallel.
#
build-admin:
name: Build admin docs
needs: build-site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: |
make build-admin
build-standards:
name: Build standards docs
needs: build-site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build site
run: |
make build-standards
build-site:
name: Build site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Use Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
JEKYLL: 1
- name: Build site
run: |
make _site
upload-artifact:
name: Upload pages artifact
needs: [build-site, build-admin, build-standards]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
depth: 1
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
# needs: [build-admin, build-standards]
needs: upload-artifact
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4