Skip to content

Commit

Permalink
ci: deploy from action
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil committed May 31, 2024
1 parent 83e20e0 commit 4cda680
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 74 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Deploy

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pages: write
id-token: write
pull-requests: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
sysfonts
ggplot2
ggtext
showtext
knitr
webshot2
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: pre-release
tinytex: true

- name: Render Quarto Project
shell: bash
run: |
quarto render template.qmd --to rlille-revealjs --output index.html --output-dir _site
- uses: actions/configure-pages@v5

- uses: actions/upload-pages-artifact@v3
with:
path: '_site'

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

- name: Update Screenshot
shell: bash
run: |
BRANCH=ci/update-thumbs
if git show-ref --quiet refs/heads/${BRANCH}; then
echo "Branch ${BRANCH} already exists."
git branch -D "${BRANCH}"
git push origin --delete "${BRANCH}"
fi
git checkout -b "${BRANCH}"
Rscript -e "webshot2::webshot(url = \"_site/index.html\", file = \"template.png\", vwidth = 1920, vheight = 1080)"
git config --local user.name github-actions[bot]
git config --local user.email 41898282+github-actions[bot]@users.noreply.github.com
git add template.png
git commit -m "ci: update thumbs"
git push --force origin ${BRANCH}
gh pr create --fill-first --base "main" --head "${BRANCH}"
gh pr merge --auto --squash --delete-branch
69 changes: 0 additions & 69 deletions .github/workflows/publish.yml

This file was deleted.

6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This is a `Quarto` `revealjs` template repository.

![Screenshot of title slide with R Lille logo in the top right corner, a white-ish background, a logo in the left surroundered by a red border, and in the right side, a block center aligned with, from top to bottom, a title, a subtitle, a red horizontal line, the author, and the date. The footer of the slide includes R Lille website and the CC-By license.](template.png)
[![Screenshot of title slide with R Lille logo in the top right corner, a white-ish background, a logo in the left surroundered by a red border, and in the right side, a block center aligned with, from top to bottom, a title, a subtitle, a red horizontal line, the author, and the date. The footer of the slide includes R Lille website and the CC-By license.](template.png)](https://rlille.github.io/quarto-revealjs-rlille/)

## Installation

Expand All @@ -20,7 +20,3 @@ This [Quarto](quarto.org) extension can be installed/used using the following co
```bash
quarto use template mcanouil/quarto-revealjs-rlille
```

## Documentation

[`Quarto` documentation on `revealjs` format.](https://quarto.org/docs/presentations/revealjs/)

0 comments on commit 4cda680

Please sign in to comment.