docs: test in json #14
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
name: π Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main # Voer de workflow uit bij elke push naar main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write # Vereist om GitHub Pages te deployen | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest # Draai de pipeline op de nieuwste Ubuntu-versie | |
steps: | |
- name: π₯ Checkout repository | |
uses: actions/checkout@v3 | |
- name: ποΈ Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" # Zorg ervoor dat de Node-versie klopt | |
cache: "pnpm" # Cache voor pnpm | |
# Installeer PNPM vΓ³Γ³r het installeren van dependencies | |
- name: π¦ Install PNPM | |
run: npm install -g pnpm # Installeer pnpm globaal | |
# Cache afhankelijkheden om builds te versnellen | |
- name: π¦ Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
# Installeer afhankelijkheden met PNPM | |
- name: π¦ Install dependencies | |
run: pnpm install # Gebruik pnpm voor snelle dependency installatie | |
- name: ποΈ Copy _redirects file | |
run: cp public/_redirects docs/_redirects | |
# Draai tests voor de build (maar faal niet als tests falen) | |
- name: π§ͺ Run Tests | |
run: pnpm test | |
# Bouw het project | |
- name: π¨ Build project | |
run: pnpm run build | |
# Deploy naar GitHub Pages | |
- name: π Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} # Gebruik de standaard GitHub token | |
publish_dir: ./docs # Map waarin de build staat na 'mv build docs' | |
keep_files: true # Behoud bestaande bestanden zoals _redirects |