v0.0.2 #4
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: CD Docs | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
BuildDocs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Checkout this Repo | |
uses: actions/checkout@v4 | |
with: | |
path: antares-results | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y ghostscript imagemagick pandoc | |
python -m pip install --upgrade pip | |
pip install sphinx sphinx-rtd-theme antares-hep | |
pip install -e antares-results | |
- name: Install LaTeX | |
run: sudo apt-get install -y texlive-luatex texlive-latex-extra texlive-fonts-recommended texlive-latex-recommended | |
- name: Build docs | |
run: | | |
cd sphinx | |
make amplitudes | |
make github | |
- name: setup git config | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "<>" | |
- name: Commit docs to gh-pages branch | |
run: | | |
cp -r docs/ docs.back/ | |
echo "fetching..." | |
git fetch | |
git reset --hard | |
echo "checking out main..." | |
git checkout main | |
echo "checking out gh-pages..." | |
git checkout gh-pages | |
rm -r docs/ | |
cp -r docs.back/ docs/ | |
touch docs/.nojekyll | |
git checkout main -- README.md | |
git add -f docs/.nojekyll | |
git add -f docs/.buildinfo | |
git add README.md docs/* | |
echo "committing changes if needed..." | |
git status | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "Automated docs update." | |
git push origin gh-pages | |
fi |