Merge pull request #50 from European-XFEL/202402/desy-311-update #122
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: Docs | |
on: | |
push: | |
branches: | |
- main | |
env: | |
GIT_COMMITTER_NAME: github-actions[bot] | |
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com | |
GIT_AUTHOR_NAME: github-actions[bot] | |
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/setup | |
with: | |
python-version: 3.8 | |
- run: poetry run poe docs build | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ./site | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build-and-upload | |
permissions: | |
contents: write | |
concurrency: | |
group: deploy | |
cancel-in-progress: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Clean | |
run: | | |
rm -rf * | |
git checkout -- pr || true | |
git status -sb | |
- uses: actions/download-artifact@v4 | |
- name: Update | |
run: | | |
mv artifact/* . | |
git status -sb | |
- name: Commit and Push | |
run: | | |
git add --all . | |
git clean -fdx | |
git commit -m "Update documentation for ${{ github.sha }}" | |
git push | |
rtd_webhook: | |
runs-on: ubuntu-latest | |
needs: deploy | |
if: github.repository_owner == 'European-XFEL' | |
steps: | |
- name: Trigger RTD User Documentation Webhook | |
run: curl -X POST ${{ secrets.RTD_USER_DOCS_WEBHOOK_URL }} -d 'token=${{ secrets.RTD_USER_DOCS_WEBHOOK_SECRET }}' |