-
Notifications
You must be signed in to change notification settings - Fork 122
102 lines (95 loc) · 3.18 KB
/
deploy-site.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
########################################################################################################################
# ENV VARS:
# - GITHUB_TOKEN (default), usage: ${{ secrets.GITHUB_TOKEN }}
########################################################################################################################
name: Deploy Site with Jekyll, GitHub Pages
on:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
push: # Runs on pushes targeting the default branch
branches:
- main
- master
paths:
- '.github/workflows/deploy-site.yml'
- 'Docs/**'
- 'Site/**'
pull_request:
branches:
- main
- master
paths:
- '.github/workflows/deploy-site.yml'
- 'Docs/**'
- 'Site/**'
milestone:
types: [ created, closed, opened, edited, deleted ]
release:
types: [ published, unpublished, created, edited, deleted, prereleased, released ]
permissions: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
contents: read
pages: write
id-token: write
concurrency: # Allow one concurrent deployment
group: "pages"
cancel-in-progress: true
jobs:
build: # Build job
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
##### Python #####
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: 'pip'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install Dependencies
run: python -m pip install -r Site/scripts/requirements.txt
- name: Generate _data/ and _docs/ folders
run: |
python --version
echo "Generating _data/milestones.yml ..."
python Site/scripts/generate_milestones.py
echo "Generating _data/releases.yml ..."
python Site/scripts/generate_releases.py
echo "Generating _docs/ and _data/sidebar.yml ..."
python Site/scripts/generate_docs.py
echo "Generated successfully!"
shell: bash
##### Python #####
##### GitHub Pages #####
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./Site
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
##### GitHub Pages #####
# Virtual job that can be configured as a required check before a PR can be
# merged.
# As GitHub considers a check as successful if it is skipped, we need to
# check its status in another workflow (check-required.yml) and create a
# check there.
all-required-checks-done:
needs:
- build
runs-on: ubuntu-latest
steps:
- run: echo "All required checks done"
deploy: # Deployment job
if: github.event_name != 'pull_request' # Skip deployment when building pull requests.
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4