Skip to content

Commit 1f7450e

Browse files
committed
Add GitHub Actions workflow for deployment
1 parent e3f757f commit 1f7450e

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Deploy Quarto Dashboard to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch: # Allow manual trigger
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup R
27+
uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- name: Install system dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y \
35+
libcurl4-openssl-dev \
36+
libssl-dev \
37+
libxml2-dev \
38+
libfontconfig1-dev \
39+
libharfbuzz-dev \
40+
libfribidi-dev \
41+
libfreetype6-dev \
42+
libpng-dev \
43+
libtiff5-dev \
44+
libjpeg-dev \
45+
libgdal-dev \
46+
libgeos-dev \
47+
libproj-dev \
48+
libudunits2-dev
49+
50+
- name: Install R packages
51+
run: |
52+
install.packages("pacman")
53+
pacman::p_load(
54+
leaflet, leaflet.extras, glue, sf, tigris, tidyverse,
55+
here, htmlwidgets, viridis, RColorBrewer, htmltools, scales
56+
)
57+
shell: Rscript {0}
58+
59+
- name: Setup Quarto
60+
uses: quarto-dev/quarto-actions/setup@v2
61+
62+
- name: Render Quarto project
63+
run: quarto render
64+
65+
- name: Setup Pages
66+
uses: actions/configure-pages@v4
67+
68+
- name: Upload artifact
69+
uses: actions/upload-pages-artifact@v3
70+
with:
71+
path: '_site'
72+
73+
deploy:
74+
environment:
75+
name: github-pages
76+
url: ${{ steps.deployment.outputs.page_url }}
77+
runs-on: ubuntu-latest
78+
needs: build
79+
steps:
80+
- name: Deploy to GitHub Pages
81+
id: deployment
82+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)