Skip to content

ci: Update deploy workflow met test en build splitsing #15

ci: Update deploy workflow met test en build splitsing

ci: Update deploy workflow met test en build splitsing #15

Workflow file for this run

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: πŸ—οΈ Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "pnpm"
- name: πŸ“¦ Install PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ§ͺ Run Tests
run: pnpm test
deploy:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v3
- name: πŸ—οΈ Install Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
cache: "pnpm"
- name: πŸ“¦ Install PNPM
uses: pnpm/action-setup@v2
with:
version: 8
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ—‚οΈ Copy _redirects file
run: cp public/_redirects docs/_redirects || echo "No _redirects found"
- name: πŸ”¨ Build project
run: pnpm run build
- name: πŸš€ Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: true