Skip to content

ci: run on branches

ci: run on branches #5

name: Test, then Build/Deploy to GitHub Pages
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Run Tests
run: bun test
build_and_deploy:
if: >
github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
environment:
name: github-pages
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v2
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Dependencies
run: bun install
- name: Run Build
run: bun run build-site
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v1
with:
path: ./build
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2