-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 1.83 KB
/
pages.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: main
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install requirements
run: |
sudo apt update
sudo apt install nodejs npm
sudo npm install -g markdownlint-cli
- name: lint
run: |
shopt -s globstar
shopt -s extglob
make lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: test the site builds
run: make build
deploy:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
needs: [lint, test]
steps:
- uses: actions/checkout@v3
- name: set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: get tag
id: tag
run: |
ref="${GITHUB_REF}"
tag=$(echo $GITHUB_REF | sed 's/refs\/tags\///g')
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: deploy
# the below steps are referenced from
# https://github.com/jimporter/mike#deploying-via-ci
run: |
git fetch origin gh-pages --depth=1
git config user.name github-actions
git config user.email [email protected]
mike deploy --push --update-aliases ${{ steps.tag.outputs.tag }} latest
mike set-default --push latest