Skip to content

Build website

Build website #118

Workflow file for this run

# The site is built on branch `dist`, in folder `docs`,
# which makes the build compatible with Github Pages and Netlify
name: Build website
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- main
- "staging**"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: "build-website"
cancel-in-progress: true
jobs:
build-website:
# Note: `github.event.base_ref` is equal to `refs/heads/main` only when the workflow is triggered
# by a lightweight tag (_not_ an annotated tag) placed on the last commit of the `main` branch
if: github.event.base_ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/staging') || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "${{ toJSON(github) }}"
- run: echo ${{ startsWith(github.ref, 'refs/tags/') }}
- run: echo "BRANCH=$(${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' }} && echo "dist" || echo "staging/dist")" >> $GITHUB_ENV
id: BRANCH
- run: echo ${{ env.BRANCH }}