Skip to content

Commit

Permalink
Enable action
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Mar 21, 2024
1 parent 489e6c6 commit 70aec21
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/publish-quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch: {}

name: demo-quarto-app

jobs:
demo-website:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: quarto-website-${{ github.event_name != 'pull_request' || github.run_id }}
permissions:
contents: read
pages: write
id-token: write
steps:
- name: "Check out repository"
uses: actions/checkout@v4

# To render using knitr, we need a few more setup steps...
# If we didn't want the examples to use `engine: knitr`, we could
# skip a few of the setup steps.
- name: "Setup pandoc"
uses: r-lib/actions/setup-pandoc@v2

- name: "Setup R"
uses: r-lib/actions/setup-r@v2

# Pinned shinylive dependency
- name: "Setup R dependencies for Quarto's knitr engine"
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages:
cran::shinylive@0.1.1
any::knitr
any::rmarkdown
any::downlit
any::xml2

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

# Install quarto extensions
- name: "Install quarto extension for shinylive and quarto-webr"
shell: bash
run: |
quarto add --no-prompt quarto-ext/shinylive
quarto add --no-prompt coatless/quarto-webr@0.4.0
# Render the Quarto file
- name: "Render working directory"
uses: quarto-dev/quarto-actions/render@v2

# Upload a tar file that will work with GitHub Pages
# Make sure to set a retention day to avoid running into a cap
# This artifact shouldn't be required after deployment onto pages was a success.
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
retention-days: 1

# Use an Action deploy to push the artifact onto GitHub Pages
# This requires the `Action` tab being structured to allow for deployment
# instead of using `docs/` or the `gh-pages` branch of the repository
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 70aec21

Please sign in to comment.