Skip to content

Commit

Permalink
Create deploy.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanya-sistla authored Jan 28, 2025
1 parent 2480285 commit 73d0e59
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy to S3 and Invalidate CloudFront

on:
push:
branches:
- dev

jobs:
deploy:
runs-on: ubuntu-latest

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: 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/*"
- name: Invalidate CloudFront Cache
run: |
aws cloudfront create-invalidation --distribution-id E2B7ZRE5H9284Z --paths "/*"

0 comments on commit 73d0e59

Please sign in to comment.