Deploy gh pages #169
Workflow file for this run
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 gh pages | |
on: | |
push: | |
branches: | |
- "main" | |
- "!gh-pages" | |
workflow_dispatch: | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
jobs: | |
deploy-storybook: | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_PREVIEW_URL }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "pnpm" | |
- name: Install deps (with cache) | |
run: pnpm install --frozen-lockfile --ignore-scripts | |
- name: Create env file | |
run: | | |
touch .env | |
echo DATABASE_URL=${DATABASE_URL} >> .env | |
- name: Build | |
run: pnpm turbo run build | |
- name: Build storybook(no cache) | |
run: pnpm turbo build:storybook | |
- name: Add vercel trigger script | |
run: | | |
mkdir packages/vujita-ui/storybook-static/apps | |
mkdir packages/vujita-ui/storybook-static/apps/vubnguyen | |
mkdir packages/vujita-ui/storybook-static/apps/vubnguyen/bin | |
cp apps/vubnguyen/bin/* ./packages/vujita-ui/storybook-static/apps/vubnguyen/bin | |
- name: Deploy to GH Pages 🚀 | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./packages/vujita-ui/storybook-static |