-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.89 KB
/
load_dashboard.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
name: Render Quarto Dashboard
on:
push:
branches:
- main
jobs:
render-dashboard:
runs-on: self-hosted
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Set up environment variables
run: |
cat <<EOF >> $GITHUB_ENV
DB_HOST=${{ secrets.DB_HOST }}
DB_PORT=${{ secrets.DB_PORT }}
DB_NAME=${{ secrets.DB_NAME }}
DB_USER=${{ secrets.DB_USER }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
EOF
- name: Install system dependencies
run: |
brew update
brew install gdal libxml2 tesseract geos
brew install [email protected] || brew upgrade pkg-config
brew unlink aws-sdk-cpp || true
brew install aws-c-common || true
brew link --overwrite aws-sdk-cpp || true
- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install renv and restore environment
run: |
Rscript -e 'install.packages("renv", repos = "https://cloud.r-project.org")'
Rscript -e 'renv::restore()'
- name: Render Quarto Dashboard
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
run: |
quarto render dashboard.qmd --output-dir docs
- name: Commit rendered files
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add docs
git commit -m "Render Quarto Dashboard" || echo "No changes to commit"
git push || echo "Push failed; ensure branch protection rules allow this"