-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (45 loc) · 1.45 KB
/
deploy-web-app.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
53
54
55
56
name: Deploy Web App
on:
push:
branches:
- main
paths: ['apps/web/**', '.github/workflows/deploy-web-app.yaml']
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v4
with:
run_install: false
- shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- run: pnpm i --ignore-scripts
- uses: actions/cache@v4
with:
path: ${{env.STORE_PATH}}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store
- name: Build
run: pnpm --filter artifacts build && pnpm --filter web build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::490752553772:role/snark-artifacts-assume_role-slc
role-duration-seconds: 900
aws-region: us-west-2
- name: Upload index.html and assets to s3 bucket
run: |
aws s3 sync apps/web/dist s3://snark-artifacts/ --exclude "*" --include "index.html" --include "assets/*" --delete