Skip to content

Update ci.yaml

Update ci.yaml #3

Workflow file for this run

name: CI
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on: push
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 14
test:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
preview:
if: ${{ github.ref != 'refs/heads/main' }}
needs: [setup, test]
runs-on: ubuntu-latest
environment:
name: preview
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Install Vercel CLI
run: npm install --global vercel
# 以下、他のステップを追加
prod:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [setup, test]
runs-on: ubuntu-latest
steps:
- name: Install Vercel CLI
run: npm install --global vercel
# 以下、他のステップを追加