-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (49 loc) · 1.48 KB
/
main.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
41
42
43
44
45
46
47
48
49
name: build-deploy
on:
push:
branches:
- source
pull_request:
branches:
- source
workflow_dispatch:
jobs:
build:
name: Build, Deploy
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Extract Branch Name
run: echo "BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- run: python --version
- run: pip install -r website/scripts/python-requirements.txt
- run: python website/scripts/create_blog_metadata.py
- uses: actions/setup-node@v4
with:
node-version: latest
- run: node --version
- run: npm --version
- working-directory: website
run: npm install
- working-directory: website
run: npm run getHighlightJsStyleSheets
- working-directory: website
run: npm run generate
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.event_name == 'push' && env.BRANCH == 'source' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/.output/public
publish_branch: main # default: gh-pages
keep_files: false # default: false
force_orphan: true
commit_message: "GitHub CI Updates [ci skip]"