-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (38 loc) · 1.42 KB
/
deploy.yml
File metadata and controls
47 lines (38 loc) · 1.42 KB
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
name: Deploy Tokkit Client
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate .env file from secret
run: |
echo "${{ secrets.CLIENT_ENV }}" > .env
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::233777023703:role/tokkit-github-actions-ecr-role
aws-region: ap-northeast-2
- name: Login to Amazon ECR
run: |
aws ecr get-login-password --region ap-northeast-2 \
| docker login --username AWS --password-stdin 233777023703.dkr.ecr.ap-northeast-2.amazonaws.com
- name: Build and Push Docker Image to ECR (Client)
run: |
docker build -t tokkit-client .
docker tag tokkit-client:latest 233777023703.dkr.ecr.ap-northeast-2.amazonaws.com/tokkit-client
docker push 233777023703.dkr.ecr.ap-northeast-2.amazonaws.com/tokkit-client
- name: Trigger CodeDeploy for Client
run: |
aws deploy create-deployment \
--application-name tokkit-client-app \
--deployment-group-name tokkit-client-dg \
--s3-location bucket=tokkit-codedeploy-bucket,key=deployments/tokkit-client.zip,bundleType=zip \
--region ap-northeast-2