Skip to content

Commit

Permalink
GitHub Actionsを使う
Browse files Browse the repository at this point in the history
  • Loading branch information
nagutabby committed Jan 4, 2025
1 parent 7b20553 commit f97a5bc
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: テストとデプロイ
on:
push:
branches: [main]

jobs:
tests:
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
with:
version: 9

- name: 依存関係をインストール
run: pnpm install

- name: テストを実行
run: pnpm test

deploy:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@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 --prebuilt --prod --token=$VERCEL_TOKEN

0 comments on commit f97a5bc

Please sign in to comment.