Skip to content

Publishing

David Carayon edited this page May 30, 2024 · 4 revisions

Gitlab Pages using CI/CD

You just need to add a .gitlab-ci.yml file to the repository root with this content (you may need to update the package list if you add more R-based content) :

# The Docker image that will be used to build your app
image: rocker/verse:4.3.1
pages:
  stage: deploy
  script:
    -  R -e "install.packages('pak')"
    -  R -e "pak::pak(c('wordcloud2','data.table','bib2df','magick'))"
    - quarto render
  publish: docs
  artifacts:
    paths:
      - docs
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

If you want to use a custom domain name provided by INRAE, see here

Github Pages using Github Actions

The following publish.yml file has to be placed in .github/workflow/ :

on:
  on:
  schedule:
    - cron: '* * 1 * *'
  workflow_dispatch:
  push:
    branches: main

name: Quarto Publish

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Check out repository
        uses: actions/checkout@v3

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

      - name: Render and Publish
        uses: quarto-dev/quarto-actions/publish@v2
        with:
          target: gh-pages

      - name: Install R Dependencies
        uses: r-lib/actions/setup-renv@v2
        with:
          cache-version: 1

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

More about Quarto publishing here : https://quarto.org/docs/publishing/

Clone this wiki locally