Skip to content

Commit f5c6998

Browse files
committed
CI: add deploy branch
1 parent 7648593 commit f5c6998

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/ci_publish.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish HTML
1+
name: Build and Publish HTML and deployed_notebooks
22

33
on:
44
push:
@@ -14,7 +14,7 @@ concurrency:
1414

1515
jobs:
1616

17-
publish:
17+
publish_html:
1818
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
1919
name: Publish HTML
2020
runs-on: ubuntu-latest
@@ -29,7 +29,7 @@ jobs:
2929
- name: Install dependencies
3030
run: python -m pip install --upgrade tox
3131

32-
- name: Execute notebooks as testing
32+
- name: Execute notebooks while building HTMLs
3333
run: tox -e py311-buildhtml
3434

3535
- name: Publish
@@ -38,3 +38,22 @@ jobs:
3838
github_token: ${{ secrets.GITHUB_TOKEN }}
3939
publish_dir: ./_build/html/
4040
commit_message: ${{ github.event.head_commit.message }}
41+
42+
deploy_notebooks:
43+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
44+
name: Deploy deployed_notebook branch
45+
runs-on: ubuntu-latest
46+
needs: publish_html
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Deploy to deployed_notebooks branch
51+
run: |
52+
git config user.name "github-actions[bot]"
53+
git config user.email "github-actions[bot]@users.noreply.github.com"
54+
gith=$(git rev-parse HEAD)
55+
git checkout --orphan deployed_notebooks
56+
git rm --cached -r .
57+
git add --pathspec-from-file=deployed_notebooks_manifest.in --force
58+
git commit -m "Deploy notebooks for commit ${gith}"
59+
git push origin deployed_notebooks --force

0 commit comments

Comments
 (0)