|
1 | | -name: deploy |
| 1 | +name: Deploy to Vercel |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: |
6 | | - - main |
7 | | - - stage |
8 | | - pull_request: |
9 | | - branches: |
10 | | - - main |
11 | | - - stage |
12 | | - types: [opened, synchronize, reopened] |
13 | | - |
14 | | -permissions: |
15 | | - deployments: write |
16 | | - pull-requests: write |
| 5 | + branches: [main, stage] |
17 | 6 |
|
18 | 7 | jobs: |
19 | | - deploy: |
| 8 | + deploy-production: |
| 9 | + if: github.ref == 'refs/heads/main' |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Deploy to Vercel (Production) |
| 16 | + uses: mountainash/deploy-to-vercel-action@v2.5.0 |
| 17 | + with: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |
| 20 | + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
| 21 | + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |
| 22 | + PRODUCTION: true |
| 23 | + ALIAS_DOMAINS: eatda.net |
| 24 | + GITHUB_DEPLOYMENT: true |
| 25 | + GITHUB_DEPLOYMENT_ENV: Production |
| 26 | + |
| 27 | + deploy-preview: |
| 28 | + if: github.ref == 'refs/heads/stage' |
20 | 29 | runs-on: ubuntu-latest |
21 | 30 | steps: |
22 | | - - uses: actions/checkout@v4 |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
23 | 33 |
|
24 | | - - uses: mountainash/deploy-to-vercel-action@v2.5.0 |
| 34 | + - name: Deploy to Vercel (Preview) |
| 35 | + uses: mountainash/deploy-to-vercel-action@v2.5.0 |
25 | 36 | with: |
26 | 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
27 | 38 | VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |
28 | 39 | VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
29 | 40 | VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |
30 | | - PRODUCTION: ${{ github.event_name == 'push' && github.ref_name == 'main' }} |
| 41 | + PRODUCTION: false |
| 42 | + ALIAS_DOMAINS: dev.eatda.net |
| 43 | + GITHUB_DEPLOYMENT: true |
| 44 | + GITHUB_DEPLOYMENT_ENV: Preview |
0 commit comments