Skip to content

Commit

Permalink
feat: add a deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
Parthipan-Natkunam committed Dec 9, 2024
1 parent ea0eeed commit 8ae0684
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build & Deploy

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/${{ secrets.ROLE_NAME }}
aws-region: ${{ secrets.REGION}}
- name: Build
run: |
npm install
npm run build
- name: Remove Old Version
run: |
aws s3 rm s3://${{ secrets.BUCKET_NAME }}/${{ secrets.DIRECTORY }} --recursive
- name: Deploy to S3
run: |
aws s3 sync ./dist s3://${{ secrets.BUCKET_NAME }}/${{ secrets.DIRECTORY }}

0 comments on commit 8ae0684

Please sign in to comment.