Deploy to GitHub Pages #8
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] | |
workflow_dispatch: | |
jobs: | |
build_site: | |
# prevents this action from running on forks | |
if: github.repository == 'binhtran432k/story-mapping-generator' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: Install dependencies | |
run: bun install --frozen-lockfile | |
- name: Build and check generated types | |
env: | |
BASE_PATH: "" | |
# BASE_PATH: "/${{ github.event.repository.name }}" | |
run: bun run build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally and commit the changes after you have reviewed them"; git diff; exit 1); } | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./packages/www/build/ | |
deploy: | |
name: Deploy Github Pages | |
runs-on: ubuntu-latest | |
needs: build_site | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |