-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.12 KB
/
frontend-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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Frontend Deploy
on:
push:
branches:
- main
paths:
- frontend/**
- packages/user-interface/**
workflow_dispatch:
jobs:
deploy:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
VERSION: ${{github.sha}}
AUTH0_DOMAIN: ${{secrets.AUTH0_DOMAIN}}
AUTH0_CLIENT_ID: ${{secrets.AUTH0_CLIENT_ID}}
AUTH0_AUDIENCE: ${{secrets.AUTH0_AUDIENCE}}
GOOGLE_API_KEY: ${{secrets.GOOGLE_API_KEY}}
BASE_URL: ${{secrets.AUTH0_DOMAIBASE_URL}}
NODE_ENV: development
AUTH0_ORIGIN: ${{secrets.AUTH0_ORIGIN}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.13.0
# - name: Get pnpm cache directory
# id: pnpm-cache-dir
# run: echo "::set-output name=dir::$(pnpm cache dir)"
# - name: Cache pnpm modules
# uses: actions/cache@v3
# with:
# path: ${{ steps.pnpm-cache-dir.outputs.dir }}
# key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install
- name: Compile code
run: pnpm run compile
- name: Build frontend
env:
NODE_ENV: production
working-directory: frontend
run: pnpm run build
- name: Create version file
working-directory: frontend
run: |
echo "{ \"version\": \"${VERSION}\" }" > ./dist/version.json
#
# Configures the AWS cli.
#
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ${{secrets.AWS_REGION}}
#
# Deploys to static web page to s3.
#
- name: Deploy to S3
working-directory: frontend
run: aws s3 cp ./dist s3://${{secrets.FRONTEND_S3_BUCKET}}/ --recursive