Merge pull request #169 from Caltech-IPAC/raen/improve-credentials-info #175
This file contains hidden or 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 Publish HTML and deployed_notebooks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 5 * * 1' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # `BASE_URL` determines, relative to the root of the domain, the URL that your site is served from. | |
| # E.g., if your site lives at `https://mydomain.org/myproject`, set `BASE_URL=/myproject`. | |
| # If, instead, your site lives at the root of the domain, at `https://mydomain.org`, set `BASE_URL=''`. | |
| BASE_URL: /${{ github.event.repository.name }} | |
| jobs: | |
| publish_html: | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| name: Publish HTML | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: python -m pip install --upgrade tox | |
| - name: Execute notebooks while building HTMLs | |
| run: tox -e py312-buildhtml | |
| - name: Publish | |
| uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_build/html/ | |
| commit_message: ${{ github.event.head_commit.message }} | |
| deploy_notebooks: | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| name: Deploy deployed_notebook branch | |
| runs-on: ubuntu-latest | |
| needs: publish_html | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Deploy to deployed_notebooks branch | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| gith=$(git rev-parse HEAD) | |
| git checkout --orphan deployed_notebooks | |
| git rm --cached -r . | |
| git add --pathspec-from-file=deployed_notebooks_manifest.in --force | |
| git commit -m "Deploy notebooks for commit ${gith}" | |
| git push origin deployed_notebooks --force |