-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (40 loc) · 1.24 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
name: Deploy to S3 and Invalidate CloudFront
on:
push:
branches:
- dev
jobs:
deploy:
runs-on: ubuntu-latest
environment: dev
permissions:
id-token: write
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Adjust as needed
- name: Create .env File
uses: 'DamianReeves/write-file-action@master'
with:
path: ./.env
write-mode: overwrite
contents: ${{ secrets.ENV_FILE }}
- name: Install NPM dependencies
run: npm install
- name: Generate static files
run: npm run build
- name: Configure AWS with OIDC
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::325553860333:role/github-website-deployment
aws-region: us-west-2
- name: Sync files to S3
run: |
aws s3 sync ./dist s3://openobserve-staging-website/ --exclude=".git/*" --exclude="assets/*"
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id E2B7ZRE5H9284Z --paths "/*"