-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.52 KB
/
CI.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
name: frontend - CI
on:
push:
branches:
- main
env:
AWS_REGION: ap-northeast-2
ECR_REPOSITORY: kakaoasset-frontend
jobs:
build-and-push-image:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- 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: ${{ env.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Docker Build and ECR push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}
- name: Move Repository
uses: actions/checkout@master
with:
repository: kakao-asset/k8s
token: ${{ secrets.TOKEN }}
path: .
- name: Edit Front Deploy menifest
run: |
sed -i "20 c\ image: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}:${{ github.sha }}" front-deploy.yaml
git config --global user.email "[email protected]"
git config --global user.name "ur2e"
git add .
git commit -m "update front-deploy.yaml"
git push -f --set-upstream origin main