Skip to content

Commit

Permalink
Merge pull request #79 from nhs-r-community/update-gh-action
Browse files Browse the repository at this point in the history
Updated gh-action
  • Loading branch information
Lextuga007 authored Nov 30, 2023
2 parents 8443c28 + 75162ad commit 2663277
Showing 1 changed file with 38 additions and 24 deletions.
62 changes: 38 additions & 24 deletions .github/workflows/quarto-publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
# Simple workflow for deploying static content to GitHub Pages
name: Publish Quarto page to GitHub Pages

on:
workflow_dispatch:
# Runs on pushes targeting the default branch
push:
branches: main
branches: ["main"]

name: Quarto Publish
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# you need these permissions to publish to GitHub pages
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-deploy:
# Single deploy job since we're just deploying
publish-site:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: ghcr.io/dukestatsci/r_gh_actions:latest
steps:
- name: Check out repository
- name: Checkout
uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-renv@v2

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Publish to GitHub Pages (and render)
uses: quarto-dev/quarto-actions/publish@v2
- name: Build site
run: |
quarto render
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: '_book/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

0 comments on commit 2663277

Please sign in to comment.