-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (52 loc) · 1.77 KB
/
Copy pathdev-deploy.yml
File metadata and controls
59 lines (52 loc) · 1.77 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
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy to AWS
on:
push:
branches:
- dev
jobs:
deploy-dev:
if: github.ref == 'refs/heads/dev'
runs-on: ubuntu-latest
steps:
- name: Checkout 코드
uses: actions/checkout@v4
- name: Node.js 22 설정
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'yarn'
- name: 🔹 .env 파일 생성
run: |
echo "${{ secrets.DEV_ENV }}" | tr ' ' '\n' > .env
- name: 의존성 설치 및 빌드
run: |
yarn install
yarn build
- name: 파일 압축
run: |
zip -r build.zip \
package.json yarn.lock next.config.ts .next public .env \
appspec.yml ecosystem.config.cjs scripts \
-x "node_modules/*" "*.log"
- name: S3에 업로드
run: aws s3 cp build.zip s3://kickon-frontend-bucket/dev/latest-build.zip
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2
- name: AWS CodeDeploy 실행
run: |
aws deploy create-deployment \
--application-name kickon-dev-frontend \
--deployment-group-name kickon-dev-frontend-group \
--s3-location bucket=kickon-frontend-bucket,key=dev/latest-build.zip,bundleType=zip
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2
- name: 배포 완료 슬랙 알림
run: |
yarn notify:deploy
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID_DEV }}