Merge pull request #14 from nagutabby/dependabot/npm_and_yarn/vitest-… #94
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: テストとデプロイ | |
on: | |
push: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Node.jsを準備 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.12.0 | |
- name: pnpmを準備 | |
uses: pnpm/action-setup@v4 | |
- name: 依存関係をインストール | |
run: pnpm install | |
- name: テストを実行 | |
run: pnpm test | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Node.jsを準備 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.12.0 | |
- name: pnpmを準備 | |
uses: pnpm/action-setup@v4 | |
- name: Vercel CLIをインストール | |
run: npm install --global vercel@latest | |
- name: Vercelにデプロイ | |
env: | |
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
run: | | |
vercel pull --yes --environment=production --token=$VERCEL_TOKEN | |
vercel build --prod --token=$VERCEL_TOKEN | |
vercel deploy --prod --token=$VERCEL_TOKEN |