Skip to content

Commit

Permalink
first try for GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielinteractive committed Jan 31, 2025
1 parent da792a1 commit 79cc756
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
74 changes: 74 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
# Github Action Workflow to publish
# the Quarto website to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- main

name: Publish Site

env:
QUARTO_DIR: "."

jobs:
publish:
name: Build & Deploy
runs-on: ubuntu-latest
container:
image: ghcr.io/insightsengineering/rstudio:latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install CRAN dependencies
run: >
install.packages(c(
"tidyverse",
"tidybayes",
"bayesplot",
"modelr",
"here",
"tictoc",
"gt",
"readxl",
"janitor",
"posterior",
"truncnorm",
"brms"
), repos = "https://cloud.r-project.org")
shell: Rscript {0}

- name: Install GitHub dependencies
run: remotes::install_github(c("genentech/jmpost"))
shell: Rscript {0}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

- name: Install cmdstanr
run: >
install.packages(
"cmdstanr",
repos = c(
"https://stan-dev.r-universe.dev",
"https://cloud.r-project.org"
)
)
shell: Rscript {0}

- name: Render Quarto Project
run: quarto render --output-dir _site
shell: bash
working-directory: ${{ env.QUARTO_DIR }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Project
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.QUARTO_DIR }}/_site
destination_dir: ${{ env.QUARTO_DIR }}
2 changes: 1 addition & 1 deletion session-tgi/_setup_and_load.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ library(janitor)
library(posterior)
library(jmpost)
library(truncnorm)
library(brms)
if (require(cmdstanr)) {
# If cmdstanr is available, instruct brms to use cmdstanr as backend
# and cache all Stan binaries
Expand Down

0 comments on commit 79cc756

Please sign in to comment.