publish #1108
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: publish | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '0 0 * * *' # end of every day | |
jobs: | |
build-and-publish: | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Requirements | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Fetch external sources | |
run: | | |
bash .github/scripts/fetch_external_sources.sh | |
- name: Sphinx build | |
run: | | |
sphinx-build -M html . build | |
- name: Publish gh-pages | |
run: | | |
cd build/html | |
git init | |
git config user.name "Key4hep bot" | |
git config user.email "[email protected]" | |
git remote add upstream https://vvolkl:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git | |
touch .nojekyll | |
git add .nojekyll | |
git commit -m "Initial commit" | |
git branch -m gh-pages | |
touch . | |
git add -A . | |
git commit -m "Rebuild page at ${GITHUB_SHA}" | |
git push -f upstream gh-pages:gh-pages |