-
-
Notifications
You must be signed in to change notification settings - Fork 18
42 lines (37 loc) · 1.34 KB
/
pages.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
35
36
37
38
39
40
name: Deploy to Github Pages
on:
push:
branches:
- 'pages'
env:
TARGET_DIR: dist/analog/public
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Set environment variable based on branch
run: |
if [[ $GITHUB_REF == refs/heads/pages ]]; then
echo "Branch is main or master. Setting DRY_RUN_OPTION to empty."
echo "DRY_RUN_OPTION=" >> $GITHUB_ENV
else
echo "Branch is not main or master. Setting DRY_RUN_OPTION to '--dry-run'."
echo "DRY_RUN_OPTION=--dry-run" >> $GITHUB_ENV
fi
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Deploy Website (gh-pages branch)
env:
GH_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }} # A token must be created to be able to deploy on the gh-pages branch
CNAME_OPTION: --cname=race.elementfuture.com # omit if your not running it on a custom domain
run: |
echo "DRY_RUN_OPTION=$DRY_RUN_OPTION"
git config user.email "[email protected]"
git config user.name "Reinier Klarenberg"
npx angular-cli-ghpages --no-silent --dir="${{env.TARGET_DIR}}" $CNAME_OPTION $DRY_RUN_OPTION