Skip to content

Commit bfb392c

Browse files
authored
Add jupyter book preview GitHub action (#7)
1 parent 466dc8c commit bfb392c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/preview-book.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: preview-book
2+
on:
3+
workflow_run:
4+
workflows:
5+
- deploy-book
6+
types:
7+
- completed
8+
jobs:
9+
deploy:
10+
if: github.repository == 'ProjectPythia/pythia-foundations'
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Download Artifact Book
18+
uses: dawidd6/[email protected]
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
workflow: deploy.yaml
22+
run_id: ${{ github.event.workflow_run.id }}
23+
name: book-zip
24+
- name: Unzip book
25+
run: |
26+
rm -rf ./_build/html
27+
unzip book.zip
28+
rm -f book.zip
29+
- name: Deploy to Netlify
30+
id: netlify
31+
uses: nwtgck/[email protected]
32+
with:
33+
publish-dir: ./_build/html
34+
production-deploy: false
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
enable-commit-comment: false
37+
env:
38+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
39+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
40+
- name: Jupyter Book Preview
41+
uses: ProjectPythia/actions/comment-netlify-preview-in-pr@main
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
deploy_url: "${{ steps.netlify.outputs.deploy-url }}"
45+
46+

0 commit comments

Comments
 (0)