-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (83 loc) · 2.87 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Quarto Publish
# Controls when the workflow will run
on:
# Triggers the workflow on push only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Setup environment, render quarto and upload GH pages artifact
build-upload:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Check out repository
uses: actions/checkout@v4
with:
lfs: true
# Downloads and installs the OS specific version of Quarto
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Check Quarto version
shell: sh
run: |
echo "Checking Quarto version"
quarto --version
- name: Setup GraphViz CLI
uses: ts-graphviz/setup-graphviz@v2
- name: Check GraphViz dot version
shell: sh
run: |
echo "Checking dot version"
dot -V
- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- run: pip install jupyter
- run: pip install -r requirements.txt
- run: pip list
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
with:
execute: never
env:
QUARTO_DENO_V8_OPTIONS: --stack-size=8192
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGCHAIN_API_KEY: ${{ secrets.LANGCHAIN_API_KEY }}
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
# - name: Render and Publish
# uses: quarto-dev/quarto-actions/publish@v2
# with:
# path: ./ds701_book
# target: gh-pages
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Deploy pages
deploy:
# Add a dependecy to the build job
needs: build-upload
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action