Skip to content

Commit dd5ac6b

Browse files
authored
Merge pull request #12 from fga-eps-mds/hotfix/34-ajusta-ambiente
fix: Ajusta deploy
2 parents 365c906 + cafc9e0 commit dd5ac6b

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/deployment.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deploy FrontEnd
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
deploy-staging:
11+
if: github.ref == 'refs/heads/develop'
12+
runs-on: ubuntu-latest
13+
env:
14+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID_STAGING }}
15+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_STAGING }}
16+
steps:
17+
- name: 🏗 Setup repo
18+
uses: actions/checkout@v3
19+
20+
- name: 🏗 Config env
21+
run: echo "$ENV_STAGING" > .env
22+
env:
23+
ENV_STAGING: ${{ secrets.ENV_STAGING }}
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 18.x
29+
30+
- name: 🏗 Install Vercel CLI
31+
run: npm i -g vercel@latest
32+
33+
- name: 🏗 Pull staging app from vercel environment
34+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }}
35+
36+
- name: 📦 Build staging app artifacts
37+
run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
38+
39+
- name: 📦 Deploy staging app artifacts to vercel
40+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
41+
42+
deploy-production:
43+
runs-on: ubuntu-latest
44+
env:
45+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
46+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
47+
steps:
48+
- name: 🏗 Setup repo
49+
uses: actions/checkout@v3
50+
51+
- name: 🏗 Config env
52+
run: echo "$ENV_PRODUCTION" > .env
53+
env:
54+
ENV_PRODUCTION: ${{ secrets.ENV_PRODUCTION }}
55+
56+
- name: Setup Node
57+
uses: actions/setup-node@v3
58+
with:
59+
node-version: 18.x
60+
61+
- name: 🏗 Install Vercel CLI
62+
run: npm i -g vercel@latest
63+
64+
- name: 🏗 Pull production vercel environment
65+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_AUTH_TOKEN }}
66+
67+
- name: 📦 Build app artifacts
68+
run: vercel build --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}
69+
70+
- name: 📦 Deploy production app artifacts to vercel
71+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_AUTH_TOKEN }}

0 commit comments

Comments
 (0)