-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (37 loc) · 1.2 KB
/
VercelProduct.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Vercel Production Deployment
on:
pull_request:
branches:
- main
types: [closed]
workflow_dispatch:
jobs:
deployment:
if: (github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
concurrency: Production
environment:
name: Production
url: ${{ steps.get_release_url.outputs.release_url }}
steps:
- uses: actions/checkout@v4
- name: Install Vercel CLI
run: npm install -g vercel
- name: Link Vercel Project
run: vercel link --token=${{secrets.VERCEL_TOKEN}} --project ${{vars.VERCEL_PROJECT}} --yes
- name: Deploy with Vercel
run: vercel deploy --prod -f --token=${{secrets.VERCEL_TOKEN}} >deployment-url.txt 2>error.txt
- name: Set release url
id: get_release_url
run: echo release_url="https://gakuseibot.pkopko.jp" >> $GITHUB_OUTPUT
- name: Faild Log
if: failure()
run: |
if [ -s error.txt ]; then
cat error.txt
exit 1
fi
- name: Show Deployment URL
run: |
deploy_url=$(cat deployment-url.txt) >> $GITHUB_ENV
echo "Deployment URL: $deploy_url"