-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (54 loc) · 1.81 KB
/
uat-piramal-s3-deployment.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
52
53
54
55
56
57
58
59
60
61
62
name: UAT S3 Deployment on the Piramal-OU Tekdi
on: [push]
jobs:
deploy_UAT_Issuer:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16.14.2'
- name: npm install, build
run: |
ls -ltra
if [ -f .env ]; then
rm .env
fi
echo '${{ secrets.UAT_ENV }}' > .env
ls -ltra
npm install -g @angular/cli@^10.0.0
npm install --legacy-peer-deps
npm run build
ng build --prod
ls -ltra
- name: Show PWD
run: |
echo "Current Working Directory:"
pwd
- name: List Contents
run: |
echo "Contents of the current directory (in reverse order):"
ls -lr dist/
- name: List Contents
run: |
echo "Contents of the dist directory (in reverse order):"
cd
ls -lr
- name: Install AWS CLI
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y awscli
- name: Configure AWS credentials
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID_DEV}}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}
aws configure set default.region ${{ secrets.AWS_S3_BUCKET_REGION }}
- name: Upload to s3 Bucket
run: |
aws s3 sync dist/sunbird-rc-ui s3://${{ secrets.AWS_S3_BUCKET_UAT }}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID_UAT }} --paths "/*"
- name: Post job cleanup
run: |
# Cleanup commands
continue-on-error: true