@@ -2,43 +2,38 @@ 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 :
7- branches : [ main ]
8- pull_request :
9- branches : [ main ]
7+ branches : [ mkdocs ]
108
119 # Allows you to run this workflow manually from the Actions tab
1210 workflow_dispatch :
1311
12+ # Needs write permission to update the gh-pages branch that is used for GitHub Pages
13+ permissions :
14+ contents : write
15+
1416# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1517jobs :
1618 # This workflow contains a single job called "build"
17- build :
18- # The type of runner that the job will run on
19+ # Copied from https://squidfunk.github.io/mkdocs-material/publishing-your-site/
20+ deploy :
1921 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
2622 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
23+ - uses : actions/checkout@v4
24+ - name : Configure Git Credentials
25+ run : |
26+ git config user.name github-actions[bot]
27+ git config user.email 41898282+github-actions[bot]@users.noreply.github.com
28+ - uses : actions/setup-python@v5
29+ with :
30+ python-version : 3.x
31+ - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
32+ - uses : actions/cache@v4
33+ with :
34+ key : mkdocs-material-${{ env.cache_id }}
35+ path : .cache
36+ restore-keys : |
37+ mkdocs-material-
38+ - run : pip install mkdocs-material
39+ - run : mkdocs gh-deploy --force
0 commit comments