@@ -2,43 +2,39 @@ name: CI
22
33# Controls when the workflow will run
44on :
5- # Triggers the workflow on push or pull request events but only for the main branch
5+ # Triggers the workflow on push events for the main branch
66 push :
77 branches : [ main ]
8- pull_request :
9- branches : [ main ]
8+ branches : [ mkdocs ]
109
1110 # Allows you to run this workflow manually from the Actions tab
1211 workflow_dispatch :
1312
13+ # Needs write permission to update the gh-pages branch that is used for GitHub Pages
14+ permissions :
15+ contents : write
16+
1417# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1518jobs :
1619 # This workflow contains a single job called "build"
17- build :
18- # The type of runner that the job will run on
20+ # Copied from https://squidfunk.github.io/mkdocs-material/publishing-your-site/
21+ deploy :
1922 runs-on : ubuntu-latest
20-
21- env :
22- STPATOOLS_VERSION : " 42e07abc5510f5864aa102aa7ae1e8349911a620"
23- STPATOOLS_REPO : " https://gitlab.com/CodethinkLabs/stpatools.git"
24-
25- # Steps represent a sequence of tasks that will be executed as part of the job
2623 steps :
27- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
28- - uses : actions/checkout@v2
29-
30- # Check that YAML files are well-formed
31- - name : YAML lint
32- run : yamllint -d relaxed .
33-
34- # Install specific version of ruamel.yaml required by STPAtools
35- - name : Install ruamel.yaml
36- run : pip3 install ruamel.yaml==0.16.7
37-
38- # Install specific version of STPA tools from repo
39- - name : Install STPA tools
40- run : pip3 install "git+${{env.STPATOOLS_REPO}}@${{env.STPATOOLS_VERSION}}"
41-
42- # Validate STPA files
43- - name : Validate STPA files (STPA_DynMA)
44- run : stpa-validate STPA_DynMA/*.yml
24+ - uses : actions/checkout@v4
25+ - name : Configure Git Credentials
26+ run : |
27+ git config user.name github-actions[bot]
28+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
29+ - uses : actions/setup-python@v5
30+ with :
31+ python-version : 3.x
32+ - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
33+ - uses : actions/cache@v4
34+ with :
35+ key : mkdocs-material-${{ env.cache_id }}
36+ path : .cache
37+ restore-keys : |
38+ mkdocs-material-
39+ - run : pip install mkdocs-material
40+ - run : mkdocs gh-deploy --force
0 commit comments