-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy: yaml 파일 변경 및 env 파일 생성 기능 추가
- Loading branch information
Showing
2 changed files
with
52 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: kakao gift | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# git 소스 체크아웃 | ||
- name: git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
|
||
# node 버전 설정 | ||
- name: setup node | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20.x | ||
# npm install 진행(모듈 설치) | ||
- name: npm install | ||
run: npm install | ||
|
||
# env 파일 생성 | ||
- name: create env file | ||
run: | | ||
touch .env | ||
echo REACT_APP_API_JUNG=${{ secrets.REACT_APP_API_JUNG }} >> .env | ||
echo REACT_APP_API_LEE=${{ secrets.REACT_APP_API_LEE }} >> .env | ||
echo REACT_APP_API_JANG=${{ secrets.REACT_APP_API_JANG }} >> .env | ||
echo REACT_APP_API_TAK=${{ secrets.REACT_APP_API_TAK }} >> .env | ||
cat .env | ||
# 리엑트 프로젝트 빌드 | ||
- name: npm build | ||
run: npm run build | ||
env: | ||
CI: false | ||
|
||
# s3에 배포 | ||
- name: deploy s3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | ||
# sync : 변경된 파일만 / --delete : 원본경로에서 삭제시 타깃에서도 삭제 | ||
aws s3 sync --delete --region ap-northeast-2 build s3://kakaogift |