-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (70 loc) · 2.39 KB
/
aws_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
name: Deploy app to AWS
on:
push:
branches: [main, develop]
paths-ignore:
- "apps/api/**"
pull_request:
branches: [main, develop, dependency_updates]
paths-ignore:
- "apps/api/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy_to_S3:
name: Deploy app to S3
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "eu-west-1"
NEXT_PUBLIC_SENTRY: "https://d48c58a239264c12bcbf8fe86d364c44@o489056.ingest.sentry.io/5799127"
steps:
- name: Check out the repo
uses: actions/checkout@v4.1.7
- name: Enable Corepack before setting up Node
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: "20.x"
cache: "yarn"
- run: corepack enable && yarn install
- run: yarn run check-types
- run: yarn run check-format
- name: Test build
env:
NEXT_PUBLIC_API_HOST: https://prod-mong-api.skde.org
run: |
yarn run export
- name: Build and sync main to S3 bucket skde.org
if: github.ref == 'refs/heads/main'
env:
NEXT_PUBLIC_API_HOST: https://prod-mong-api.skde.org
run: |
yarn run export
aws s3 sync apps/skde/out s3://skde.org \
--exclude "helseatlas/files/*" \
--delete \
--cache-control "public, max-age=1, s-maxage=1"
- name: Build and sync develop to S3 bucket qa.skde.org
if: github.ref == 'refs/heads/develop'
env:
NEXT_PUBLIC_API_HOST: https://qa-mong-api.skde.org
run: |
yarn run export
aws s3 sync apps/skde/out s3://qa.skde.org \
--exclude "helseatlas/files/*" \
--delete \
--cache-control "public, max-age=1, s-maxage=1"
- name: Build and sync to verify page
if: github.ref == 'refs/heads/main'
env:
NEXT_PUBLIC_API_HOST: https://verify-mong-api.skde.org
run: |
yarn run export
aws s3 sync apps/skde/out s3://verify.skde.org \
--exclude "helseatlas/files/*" \
--delete \
--cache-control "public, max-age=1, s-maxage=1"