-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (52 loc) · 1.76 KB
/
api-deploy.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI/CD Pipeline
on:
push:
branches:
- release
paths:
- "src/**"
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: pnpm/action-setup@v3
with:
version: 8
- name: Create .env file
uses: SpicyPizza/create-envfile@v2.0
with:
file_name: .env.production
fail_on_empty: false
sort_keys: false
# Ignore these erros, they are false positive
envkey_PORT: ${{ secrets.PORT }}
envkey_NODE_ENV: ${{ secrets.NODE_ENV }}
envkey_AWS_REGION: ${{ secrets.AWS_REGION }}
envkey_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
envkey_GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
envkey_FACEBOOK_CLIENT_ID: ${{ secrets.FACEBOOK_CLIENT_ID }}
envkey_FACEBOOK_CLIENT_SECRET: ${{ secrets.FACEBOOK_CLIENT_SECRET }}
envkey_PASETO_PRIVATE_KEY: ${{ secrets.PASETO_PRIVATE_KEY }}
envkey_DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Build
run: |
pnpm i --ignore-scripts
pnpm run build
- name: AWS CodeBuild & CodeDeploy
uses: sourcetoad/aws-codedeploy-action@v1
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
codedeploy_name: Econominhas
codedeploy_group: development_gropup
s3_bucket: econominhas-dev-api-deploy
s3_folder: api
max_polling_iterations: 60
directory: dist