Skip to content

Commit f3398c9

Browse files
authored
Update static.yml
1 parent 98f8f9d commit f3398c9

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

.github/workflows/static.yml

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,65 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: Deploy Pages
33

4+
# Controls when the action will run.
45
on:
5-
# Runs on pushes targeting the default branch
6-
push:
7-
branches: ["main"]
86

9-
# Allows you to run this workflow manually from the Actions tab
7+
# Trigger the deployment manually
108
workflow_dispatch:
119

10+
# Trigger the deployment on push to the main branch
11+
push:
12+
13+
# Only the main branch
14+
branches:
15+
- "main"
16+
17+
# Only when the docs directory or mkdocs.yml file changes
18+
paths:
19+
- "docs/**"
20+
- mkdocs.yml
21+
1222
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1323
permissions:
1424
contents: read
1525
pages: write
1626
id-token: write
1727

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
28+
# Allow one concurrent deployment
2029
concurrency:
2130
group: "pages"
22-
cancel-in-progress: false
31+
cancel-in-progress: true
2332

33+
# Define the jobs that run in the workflow
2434
jobs:
25-
# Single deploy job since we're just deploying
35+
36+
# The build job
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
- run: ls -la
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v2
45+
- name: Setup Python, install plugins, and build site
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: 3.x
49+
- run: pip install mkdocs
50+
- run: pip install mkdocs-section-index
51+
- run: mkdocs build --site-dir ./_site
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v1
54+
55+
# The deployment job
2656
deploy:
2757
environment:
2858
name: github-pages
2959
url: ${{ steps.deployment.outputs.page_url }}
3060
runs-on: ubuntu-latest
61+
needs: build
3162
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
- name: Setup Pages
35-
uses: actions/configure-pages@v5
36-
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
38-
with:
39-
# Upload entire repository
40-
path: '.'
4163
- name: Deploy to GitHub Pages
4264
id: deployment
43-
uses: actions/deploy-pages@v4
65+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)