ci: pnpm install #6
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 production | |
on: | |
push: | |
branches: | |
- main | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install Dependencies | |
run: pnpm | |
- name: Build Application | |
run: pnpm build | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install Dependencies | |
run: pnpm | |
- name: Run Tests | |
run: pnpm test | |
production: | |
needs: [test] | |
name: Deploy to Production | |
runs-on: ubuntu-latest | |
steps: | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Install Dependencies | |
run: pnpm i | |
- name: Install Vercel CLI | |
run: pnpm -g add vercel | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |