Skip to content

Commit

Permalink
deploy: yaml 파일 변경 및 env 파일 생성 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobbymin committed Aug 1, 2024
1 parent 10bd945 commit aeb4864
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 48 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/ci.yaml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/kakao.gift.yaml
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

0 comments on commit aeb4864

Please sign in to comment.