Skip to content
R for the Rest of Us Logo

Using Git and GitHub with R

Use GitHub Actions to Run Code Automatically

Transcript

Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

View code shown in video
on:
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Install R
        uses: r-lib/actions/setup-r@v2

      - name: Install packages
        uses: r-lib/actions/setup-r-dependencies@v2
        with:
          packages: |
            any::dplyr
            any::readxl
            any::gt
            
      - name: Check out repository
        uses: actions/checkout@v4 

      - name: Set up Quarto
        uses: quarto-dev/quarto-actions/setup@v2
        
      - name: Render and Publish 
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: netlify
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

Learn More

I wrote a blog post in 2023 about GitHub Actions.

If you want to learn about publishing Quarto documents to Netlify with GitHub Actions, the Quarto docs has instructions for doing so.

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.