vercel 運用
#vercel
デプロイ
mainブランチをpreview環境にする
productionブランチがproduction環境にする
mainにマージしても勝手にproductionデプロイされない状態. (ただしmainブランチのpreviewだけは自動でデプロイされる)
productionデプロイするためにはgithub actionのworkflow dispatchでキックする
code:deploy.yaml
on:
workflow_dispatch:
inputs:
target:
description: Production Deploy target branch
required: true
default: main
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.target }}
- name: Deploy to vercel
# sync main branch to production branch and kick vercel deploy
run: |
git switch -c production
git push -f origin production