Skip to content

Commit

Permalink
Merge pull request #65 from LocalMingle/dw
Browse files Browse the repository at this point in the history
dotenv test
  • Loading branch information
totobon6125 authored Oct 23, 2023
2 parents 440af29 + 7afcfbb commit bbfbb3c
Showing 1 changed file with 45 additions and 26 deletions.
71 changes: 45 additions & 26 deletions .github/workflows/nest_lm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ on:

env:
PROJECT_NAME: local_mingle
BUCKET_NAME: s3-bucket-local-mingle
CODE_DEPLOY_APP_NAME: CD-app-local-mingle
DEPLOYMENT_GROUP_NAME: CD-app-group-local-mingle
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
CODE_DEPLOY_APP_NAME: ${{ secrets.CODE_DEPLOY_APP_NAME }}
DEPLOYMENT_GROUP_NAME: ${{ secrets.DEPLOYMENT_GROUP_NAME }}

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
Expand All @@ -33,24 +30,46 @@ jobs:
- run: npm ci
- run: npm run build --if-present

# S3로 보낼 압축 파일 생성
- name: zip file
# .env 파일 생성
- name: Create .env
run: |
# zip으로 압축파일 생성
# CI.zip은 압축 파일 이름, 나머지는 압축할 코드 파일 또는 폴더를 지정합니다.
# workflow와 동일한 위치의 폴더와 파일을 압축합니다.
zip -qq -r ./$GITHUB_SHA.zip .
# AWS 인증하기
- name: AWS configure credentials
uses: aws-actions/configure-aws-credentials@v1
with:
# 엑세스 키 입력
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# 엑세스 시크릿 키 입력
aws-secret-access-key: ${{ secrets.AWS_PRIVATE_ACCESS_KEY }}
# 지역 설정: 서울
aws-region: ap-northeast-2
echo "DATABASE_URL=$DATABASE_URL" > .env
echo "JWT_ACCESS_KEY=$JWT_ACCESS_KEY" >> .env
echo "JWT_REFRESH_KEY=$JWT_REFRESH_KEY" >> .env
echo "KAKAO_CLIENT_ID=$KAKAO_CLIENT_ID" >> .env
echo "KAKAO_CLIENT_SECRET=$KAKAO_CLIENT_SECRET" >> .env
echo "KAKAO_CALLBACK_URL=$KAKAO_CALLBACK_URL" >> .env
echo "EMAIL_USER=$EMAIL_USER" >> .env
echo "EMAIL_PASS=$EMAIL_PASS" >> .env
echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> .env
echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> .env
echo "AWS_REGION=$AWS_REGION" >> .env
echo "AWS_BUCKET_NAME=$AWS_BUCKET_NAME" >> .env
echo "GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" >> .env
echo "GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET" >> .env
echo "GOOGLE_CALLBACK_URL=$GOOGLE_CALLBACK_URL" >> .env
echo "NAVER_CLIENT_ID=$NAVER_CLIENT_ID" >> .env
echo "NAVER_CLIENT_SECRET=$NAVER_CLIENT_SECRET" >> .env
echo "NAVER_CALLBACK_URL=$NAVER_CALLBACK_URL" >> .env
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWT_ACCESS_KEY: ${{ secrets.JWT_ACCESS_KEY }}
JWT_REFRESH_KEY: ${{ secrets.JWT_REFRESH_KEY }}
KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
KAKAO_CLIENT_SECRET: ${{ secrets.KAKAO_CLIENT_SECRET }}
KAKAO_CALLBACK_URL: ${{ secrets.KAKAO_CALLBACK_URL }}
EMAIL_USER: ${{ secrets.EMAIL_USER }}
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PRIVATE_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_CALLBACK_URL: ${{ secrets.GOOGLE_CALLBACK_URL }}
NAVER_CLIENT_ID: ${{ secrets.NAVER_CLIENT_ID }}
NAVER_CLIENT_SECRET: ${{ secrets.NAVER_CLIENT_SECRET }}
NAVER_CALLBACK_URL: ${{ secrets.NAVER_CALLBACK_URL }}

# S3로 업로드하기
- name: upload to S3
Expand All @@ -59,7 +78,7 @@ jobs:
# codeDeploy 실행
- name: request deploy to codedeploy
run: aws deploy create-deployment
--application-name CD-app-local-mingle
--application-name $CODE_DEPLOY_APP_NAME
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name CD-app-group-local-mingle
--s3-location bucket=s3-bucket-local-mingle,bundleType=zip,key=local_mingle/$GITHUB_SHA.zip
--deployment-group-name $DEPLOYMENT_GROUP_NAME
--s3-location bucket=$BUCKET_NAME,bundleType=zip,key=local_mingle/$GITHUB_SHA.zip

0 comments on commit bbfbb3c

Please sign in to comment.