update publish workflow #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build and deploy docs pages" | |
on: | |
push: | |
branches: | |
- doc-rest-migration | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install doxygen | |
- name: "Checkout" | |
uses: actions/[email protected] | |
with: | |
persist-credentials: false | |
submodules: recursive | |
- name: "Setup python for sphinx" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: "Install python dependencies" | |
run: | | |
pip3 install setuptools six | |
pip3 install sphinx-fortran | |
pip3 install sphinx_sitemap | |
pip3 install numpy | |
pip3 install breathe | |
pip3 install sphinx-book-theme | |
pip3 install linkchecker | |
- name: "Build sphinx doc" | |
run: | | |
cd CGNS-ReST-site | |
make html | |
shell: bash | |
- name: "Check for broken links" | |
run: | | |
cd CGNS-ReST-site/docs/html/ | |
linkchecker --check-extern ./index.html | |
continue-on-error: true | |
- name: "Deploy" | |
run: | | |
cd CGNS-ReST-site | |
git clone -b gh-pages --single-branch https://github.com/CGNS/cgns-modern.github.io.git docs/deploy | |
rsync -q -av --checksum --progress docs/html/ docs/deploy | |
cd docs/deploy | |
git config --global user.name 'autopages' | |
git config --global user.email '[email protected]' | |
git add --all . | |
git commit -m "Update gh-pages" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
git push | |
shell: bash | |