Skip to content

feat: Setup repository for handbook v2.0.0alpha release with documentation improvements #163

feat: Setup repository for handbook v2.0.0alpha release with documentation improvements

feat: Setup repository for handbook v2.0.0alpha release with documentation improvements #163

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
name: Render and Publish
permissions:
contents: write
pages: write
jobs:
lint:
name: Lint with Prettier
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Check for linting errors
run: pnpm run check
build-deploy:
runs-on: macos-latest
needs: lint
steps:
- name: Set Timezone
uses: szenius/[email protected]
with:
timezoneMacos: 'Europe/Zurich'
- name: Check out repository
uses: actions/checkout@v4
- name: Overwrite _quarto.yml
if: github.repository == 'maehr/open-research-data-template'
run: |
cp .github/_quarto.yml _quarto.yml
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tinytex: true
- name: Cache Brew dependencies
uses: actions/cache@v4
with:
path: /usr/local/Homebrew
key: ${{ runner.os }}-brew-${{ hashFiles('**/quarto-publish.yml') }}
restore-keys: |
${{ runner.os }}-brew-
- name: Set up TeX dependencies
run: |
tlmgr install hyphen-german
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
with:
path: manuscript
to: all
- name: Install Chromium
run: |
brew install --cask chromium
- name: Convert html to pdf with Chromium
run: |
chromium --headless --disable-gpu --print-to-pdf=manuscript/_manuscript/handbuch-diskriminierungsfreie-metadaten.pdf --scale=1.0 --no-pdf-header-footer --print-background --virtual-time-budget=10000 file:///$(pwd)/manuscript/_manuscript/index.html
- name: JamPack
run: |
npx @divriots/jampack .
- name: Publish to GitHub Pages
uses: quarto-dev/quarto-actions/publish@v2
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
with:
path: manuscript
target: gh-pages
render: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}