1
- # This is a basic workflow to help you get started with Actions
2
-
3
- name : CI
4
-
5
- # Controls when the workflow will run
1
+ name : ci
6
2
on :
7
- # Triggers the workflow on push or pull request events but only for the "main" branch
8
3
push :
9
- branches : [ "main" ]
10
- pull_request :
11
- branches : [ "main" ]
12
-
13
- # Allows you to run this workflow manually from the Actions tab
14
- workflow_dispatch :
15
-
16
- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
4
+ branches :
5
+ - master
6
+ - main
7
+ permissions :
8
+ contents : write
17
9
jobs :
18
- # This workflow contains a single job called "build"
19
- build :
20
- # The type of runner that the job will run on
10
+ deploy :
21
11
runs-on : ubuntu-latest
22
-
23
- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
24
- permissions :
25
- pages : write # to deploy to Pages
26
- id-token : write # to verify the deployment originates from an appropriate source
27
-
28
- environment :
29
- name : github-pages
30
- url : ${{ steps.deployment.outputs.page_url }}
31
- # Steps represent a sequence of tasks that will be executed as part of the job
32
12
steps :
33
-
34
- - name : Configure Pages
35
- uses : actions/configure-pages@v4
36
-
37
- - name : Setup Python
38
- uses : actions/setup-python@v5.1.0
13
+ - uses : actions/checkout@v4
14
+ - name : Configure Git Credentials
15
+ run : |
16
+ git config user.name github-actions[bot]
17
+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
18
+ - uses : actions/setup-python@v5
39
19
with :
40
- python-version : 3.12
41
-
42
- # Runs a single command using the runners shell
43
- - name : Install dependencies
44
- run : pip3 install mkdocs mkdocs-material
45
-
46
- - name : Build website
47
- run : mkdocs build
48
-
49
- - name : Deploy to GitHub Pages
50
- uses : actions/deploy-pages@v4
20
+ python-version : 3.x
21
+ - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22
+ - uses : actions/cache@v4
23
+ with :
24
+ key : mkdocs-material-${{ env.cache_id }}
25
+ path : .cache
26
+ restore-keys : |
27
+ mkdocs-material-
28
+ - run : pip install mkdocs-material
29
+ - run : mkdocs gh-deploy --force
0 commit comments