publish #695
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: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- 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 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
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 |