Switch to ESLint and Prettier #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
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Setup ESLint cache | |
uses: actions/cache@v3 | |
with: | |
path: .eslintcache | |
key: | | |
${{ runner.os }}-eslint-${{ hashFiles('.eslintrc.js') }} | |
restore-keys: | | |
${{ runner.os }}-eslint- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Lint | |
run: pnpm run lint | |
- name: Format | |
run: pnpm run format:check | |
- name: Build | |
run: pnpm run build | |
- name: Apply migrations | |
run: pnpm run db:migrate:apply:prod | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
- name: Deploy | |
run: pnpm exec wrangler pages deploy | |
env: | |
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} |