-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (39 loc) · 1.33 KB
/
deploy.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI/CD - Production - Pipeline
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deployment:
runs-on: ubuntu-latest
env:
ENV: production
NUXT_PUBLIC_API_BASE: https://api.lets.tur.br
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_S3_REGION }}
- name: Repository Name
run: echo ${{ github.repository }}
- name: Get bucket name
id: get-bucket-name
run: echo "::set-output name=name::v2.lets.tur.br"
- name: S3 Search
id: s3-search-bucket
run: echo "::set-output name=code::$(aws s3 ls s3://${{ steps.get-bucket-name.outputs.name }} || echo $?)"
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install dependencies
run: npm i
- name: Build
run: npm run generate
- name: S3 Sync
if: success()
run: aws s3 sync .output/public/ s3://${{ steps.get-bucket-name.outputs.name }}