|
9 | 9 |
|
10 | 10 | # This job installs dependencies, build the book, and pushes it to `gh-pages`
|
11 | 11 | jobs:
|
| 12 | + render-knitr-quarto: |
| 13 | + uses: ./.github/workflows/render-knitr-quarto.yml |
| 14 | + |
12 | 15 | deploy-book:
|
13 | 16 | runs-on: ubuntu-latest
|
| 17 | + needs: render-knitr-quarto |
| 18 | + |
14 | 19 | steps:
|
15 | 20 | - uses: actions/checkout@v4
|
16 | 21 |
|
17 | 22 | # Install dependencies
|
18 |
| - - name: Set up Python 3.10 |
19 |
| - uses: actions/setup-python@v5 |
20 |
| - with: |
21 |
| - python-version: "3.10" |
22 |
| - |
23 |
| - - name: cache installation |
24 |
| - uses: actions/cache@v3 |
25 |
| - with: |
26 |
| - path: ${{ env.pythonLocation }} |
27 |
| - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }} |
| 23 | + - name: Set up Quarto |
| 24 | + uses: quarto-dev/quarto-actions/setup@v2 |
28 | 25 |
|
29 |
| - - name: Install dependencies |
30 |
| - run: | |
31 |
| - pip install -r requirements.txt |
32 |
| - # Build the book |
33 |
| - - name: Build the book |
34 |
| - run: | |
35 |
| - jupyter-book build . |
| 26 | + - name: Install uv |
| 27 | + uses: astral-sh/setup-uv@v6 |
36 | 28 |
|
37 |
| - # Push the book's HTML to github-pages |
38 |
| - - name: GitHub Pages action |
39 |
| - uses: peaceiris/actions-gh-pages@v4 |
40 |
| - if: ${{ github.ref == 'refs/heads/main' }} |
| 29 | + # GitHub caches Python versions with the runner thus likely faster than uv |
| 30 | + - name: Set up Python |
| 31 | + uses: actions/setup-python@v5 |
41 | 32 | with:
|
42 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
43 |
| - publish_dir: ./_build/html |
44 |
| - |
45 |
| - # # Push to CS server |
46 |
| - # - name: rsync and ssh to CS |
47 |
| - # env: |
48 |
| - # COURSE_REMOTE_HOST: kunghit.students.cs.ubc.ca |
49 |
| - # COURSE_REMOTE_USER: cs-330 |
50 |
| - # CS_REMOTE_USER: firasm |
51 |
| - # CS_TUNNEL: remote.cs.ubc.ca |
52 |
| - # REMOTE_KEY: ${{ secrets.FIRAS_SERVER_SSH_KEY }} |
53 |
| - # FIRAS_KEYBOARDMBP: ${{ secrets.FIRAS_KEYBOARDMBP }} |
54 |
| - # TERM: 2024_W1 |
55 |
| - # LOCAL_DIR: _build/html/ |
56 |
| - # run: | |
57 |
| - # mkdir -p ~/.ssh |
58 |
| - # echo "$REMOTE_KEY" > ~/.ssh/id_rsa |
59 |
| - # chmod 600 ~/.ssh/id_rsa |
60 |
| - # ssh-keyscan -H $CS_TUNNEL >> ~/.ssh/known_hosts |
61 |
| - |
62 |
| - # echo "$FIRAS_KEYBOARDMBP" > ~/.ssh/id_ed25519 |
63 |
| - # chmod 600 ~/.ssh/id_ed25519 |
64 |
| - |
65 |
| - # # Set up a tunnel in the background |
66 |
| - # ssh -fN -L 2222:$COURSE_REMOTE_HOST:22 $CS_REMOTE_USER@$CS_TUNNEL -p 22 |
67 |
| - |
68 |
| - # # send files all in one shot |
69 |
| - # rsync -avzr -e 'ssh -p 22 -o StrictHostKeyChecking=no -J $CS_REMOTE_USER@$CS_TUNNEL' $LOCAL_DIR $COURSE_REMOTE_USER@$COURSE_REMOTE_HOST:public_html/$TERM |
70 |
| - |
| 33 | + python-version-file: "pyproject.toml" |
| 34 | + |
| 35 | + - name: Install Python dependencies |
| 36 | + run: uv sync --locked --all-extras |
| 37 | + |
| 38 | + - name: Install R |
| 39 | + uses: r-lib/actions/setup-r@v2 |
| 40 | + with: |
| 41 | + r-version: '4.2.0' |
| 42 | + |
| 43 | + - name: Install R Dependencies |
| 44 | + uses: r-lib/actions/setup-renv@v2 |
| 45 | + with: |
| 46 | + cache-version: 1 |
| 47 | + |
| 48 | + - name: Render and Publish Quarto project |
| 49 | + uses: quarto-dev/quarto-actions/publish@v2 |
| 50 | + with: |
| 51 | + target: gh-pages |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments