-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (27 loc) · 958 Bytes
/
build-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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 }}