-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.35 KB
/
Copy pathdeploy.yml
File metadata and controls
49 lines (40 loc) · 1.35 KB
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
name: Deploy to opensession.groupnetwork.com
on:
push:
branches: [production]
permissions:
id-token: write # OIDC → arn:aws:iam::218827615080:role/opensession-deploy
contents: read
concurrency:
group: production-deploy
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: app/package-lock.json
- run: npm ci
- run: npx vitest run
- run: npm run build
env:
VITE_OAUTH_CLIENT_ID: ${{ vars.OAUTH_CLIENT_ID }}
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::218827615080:role/opensession-deploy
aws-region: us-east-1
- name: Sync to S3
run: |
aws s3 sync dist/ s3://opensession.groupnetwork.com/ --delete \
--cache-control "public,max-age=31536000,immutable" --exclude index.html
aws s3 cp dist/index.html s3://opensession.groupnetwork.com/index.html \
--cache-control "public,max-age=60,must-revalidate"
- name: Invalidate CloudFront
run: aws cloudfront create-invalidation --distribution-id E1ECGJB4KUGGL5 --paths "/index.html" "/"