-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add workflow .yml for github ci
- Loading branch information
Soham Sevak
committed
Oct 26, 2023
1 parent
9080cae
commit 5cc5265
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Deploy | ||
run-name: Deploy to AWS | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: ng run user-interface:ngsscbuild:production | ||
|
||
- name: Deploy | ||
run: | ||
aws s3 sync ./dist/user-interface ${{ secrets.S3_BUCKET }} --region ${{ secrets.AWS_DEFAULT_REGION }} --delete | ||
echo "Invalidating Old Distribution" | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/*' | ||
echo "Deployed Successfully" |