-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.33 KB
/
main.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Deploy to S3 and Lambda
on:
push:
branches: ["develop", "release/*"]
env:
AWS_REGION_SEOUL: ap-northeast-2
AWS_REGION_US: us-east-1
BUCKET_NAME: chusome.com
FUNCTION_NAME: chu-some-chu-some
# containerDefinitions section of your task definition
jobs:
deploy_static:
name: Deploy to S3
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION_SEOUL }}
- name: Upload static files to S3
run: |
aws s3 sync ./static/ s3://${{env.BUCKET_NAME}}/ --delete
deploy_core:
name: Deploy to lambda
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION_US }}
- name: Compress python code to zip
run: |
cd lambda_ai
zip -r lambda.zip ./*
aws lambda update-function-code --function-name ${{env.FUNCTION_NAME}} --zip-file fileb://lambda.zip
# build_kotlin:
# runs-on: ubuntu-latest
# steps:
# # 1. 저장소 체크아웃
# - name: Checkout repository
# uses: actions/checkout@v3
# # 2. Docker 로그인 (GitHub Packages 사용 시)
# - name: Log in to GitHub Container Registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# # 3. Docker 이미지 빌드 및 푸시
# - name: Build and push Docker image
# run: |
# docker build -t ghcr.io/${{ github.repository }}/my-app:${{ github.sha }} .
# docker push ghcr.io/${{ github.repository }}/my-app:${{ github.sha }}
# deploy_kotlin:
# runs-on: ubuntu-latest
# needs: build_kotlin
# if: github.ref == 'refs/heads/main'
# steps:
# - name: Deploy to production
# run: |
# echo "배포 스크립트 추후에 추가예정"