Fix quarto publishing pages #1735
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches-ignore: | |
- master | |
- main | |
pull_request: | |
branches: | |
- main | |
- master | |
name: preview bookdown | |
jobs: | |
build: | |
if: "!contains(github.event.commits[0].message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
container: inseefrlab/utilitr:latest | |
steps: | |
- name: Checkout Repository | |
if: ${{ github.repository == 'inseefrlab/utilitr' }} | |
env: | |
GITHUB_PAT: ${{ secrets.PAT }} | |
uses: actions/checkout@master | |
- name: Install Dependencies | |
if: ${{ github.repository == 'inseefrlab/utilitr' }} | |
run: | | |
Rscript -e "install.packages(c('remotes', 'htmltools', 'sf'))" | |
env: | |
GITHUB_PAT: ${{ secrets.PAT }} | |
- name: Render Book | |
run: | | |
quarto render | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: _public | |
path: _public/ | |
retention-days: 5 | |
- name: Install npm | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Deploy to Netlify | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
# NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
BRANCHE_REF: ${{ github.event.pull_request.head.ref }} | |
run: | | |
npm init -y | |
npm install --unsafe-perm=true netlify-cli -g | |
netlify init | |
netlify deploy --alias=${BRANCHE_REF} --dir="_public" --message "Preview deploy from ${BRANCHE_REF}" | |
#--site="$NETLIFY_SITE_ID" --auth="$NETLIFY_AUTH_TOKEN" |