Astro #39
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: CI | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
create-neon-branch: | |
name: 🚀 Create Neon Branch | |
runs-on: ubuntu-latest | |
outputs: | |
database_url: ${{ steps.create-branch.outputs.db_url }} | |
steps: | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Create neon branch | |
uses: neondatabase/[email protected] | |
with: | |
project_id: ${{ secrets.NEON_PROJECT_ID }} | |
branch_name: ${{ steps.branch-name.outputs.current_branch }} | |
username: ${{ secrets.PG_USERNAME }} | |
api_key: ${{ secrets.NEON_API_KEY }} | |
id: create-branch | |
main: | |
name: 🧾 Main CI Checks | |
runs-on: ubuntu-latest | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
AUTH_GITHUB_CLIENT_ID: ${{ secrets.AUTH_GITHUB_CLIENT_ID }} | |
AUTH_GITHUB_CLIENT_SECRET: ${{ secrets.AUTH_GITHUB_CLIENT_SECRET }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Spell check | |
run: pnpm turbo lint:spell | |
- name: Lint Markdown | |
run: pnpm turbo lint:md | |
- name: Check Formatting | |
run: pnpm turbo format:check | |
- name: Lint | |
run: pnpm turbo lint | |
- name: Typecheck | |
run: pnpm turbo typecheck | |
- name: Build | |
env: | |
DATABASE_URL: ${{ needs.create-neon-branch.outputs.database_url }} | |
run: pnpm turbo build |