Skip to content

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')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "BRANCH=$([[ "$(git rev-parse HEAD)" == "$(git rev-parse main)" ]] && echo "dist" || echo "staging/dist")" >> $GITHUB_ENV
id: BRANCH
- run: echo ${{ env.BRANCH }}