-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (72 loc) · 2.58 KB
/
main.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
name: Render and deploy Quarto files
on:
push:
pull_request:
jobs:
quarto-render-and-deploy:
runs-on: ubuntu-latest
container: rocker/verse:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
GITHUB_PAT: ${{ secrets.GH_PAT }}
WORKON_HOME: "~/.virtualenvs"
steps:
- uses: actions/checkout@v4
- name: Change ownership of /github/home
run: sudo chown -R $(whoami) /github/home
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt upgrade
sudo apt install -y libudunits2-dev libgdal-dev
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
shell: /bin/bash {0}
- name: Setup Python and virtual environment using requirements file
id: setup-python-venv
uses: srvanderplas/[email protected]
with:
python-version-file: '.python-version'
cache-dependency-path: requirements.txt
install-cmd: "./py-deps -i"
- name: Test
run: |
echo $RETICULATE_PYTHON;
echo $RETICULATE_PYTHON_ENV;
echo "$pythonLocation" >> $GITHUB_PATH;
- name: Renv setup
uses: r-lib/actions/setup-renv@v2
- name: Renv and R install status
shell: Rscript {0}
run: |
renv::status()
renv::diagnostics()
- name: Reticulate checks
shell: Rscript {0}
run: |
print(getwd())
system("bash venv/bin/activate")
system("which python")
devtools::session_info()
reticulate::py_config()
reticulate::use_virtualenv("${{ env.VIRTUAL_ENV }}")
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.5.57
tinytex: true
- name: Render Quarto Project
shell: /bin/bash {0}
run: |
quarto render --execute-debug
- name: "Deploy to gh-pages"
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs