Skip to content

Commit

Permalink
split actions
Browse files Browse the repository at this point in the history
  • Loading branch information
brtarran committed Jul 19, 2023
1 parent ec8d171 commit 57f12db
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Render PDF and Publish Site
name: Render PDF

on:
workflow_dispatch:
Expand All @@ -8,43 +8,8 @@ on:
branches: main

jobs:
render:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

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

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R packages
run: |
install.packages(c("knitr", "rmarkdown", "quarto", "stringr"))
shell: Rscript {0}

- name: Render PDF
run: |
quarto::quarto_render("_make_pdf.qmd")
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add RSS-data-vis-guide.pdf
git commit -m "Render PDF"
git push
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

build-deploy:
if: "contains(github.event.head_commit.message, '[Render PDF]')"
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -54,17 +19,19 @@ jobs:

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

with:
tinytex: true

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R packages
run: |
install.packages(c("knitr", "rmarkdown", "quarto", "stringr"))
shell: Rscript {0}

- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2

Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/render_PDF.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Render PDF

on:
workflow_dispatch:
push:
branches: main
pull_request:
branches: main

jobs:
render:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

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

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R packages
run: |
install.packages(c("knitr", "rmarkdown", "quarto", "stringr"))
shell: Rscript {0}

- name: Render PDF
run: |
quarto::quarto_render("_make_pdf.qmd")
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add RSS-data-vis-guide.pdf
git commit -m "Render PDF"
git push
env:
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 57f12db

Please sign in to comment.