-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (34 loc) · 1.15 KB
/
deploy-prod.yml
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
name: Deploy Prod
on:
release:
types:
- published
workflow_dispatch:
jobs:
deploy:
name: Deploy Prod
runs-on: ubuntu-22.04
environment: Production
env:
READ_PRIVATE_SUBMODULE_TOKEN: ${{ secrets.READ_PRIVATE_SUBMODULE_TOKEN }}
WORKING_DIRECTORY: ${{ vars.DEPLOY_WORKING_DIRECTORY }}
DEPLOY_FILENAME: ${{ vars.DEPLOY_FILENAME }}
S3_REGION: ${{ vars.S3_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
submodules: true
token: ${{ env.READ_PRIVATE_SUBMODULE_TOKEN }}
- name: Install AWS cli
run: |
sudo apt-get update
sudo apt-get install awscli
- name: Deploy code to AWS S3
run: |
zip -r ${{ env.DEPLOY_FILENAME }} appspec.yml app env deploy-script
aws s3 cp ${{ env.DEPLOY_FILENAME }} s3://stat-ec2-app-code-deploy-bucket/${{ env.DEPLOY_FILENAME }} --region ${{ env.S3_REGION }}
working-directory: ${{ env.DEPLOY_WORKING_DIRECTORY }}