refactor : 외국인 고객인 설문 조사를 하지 않는 경우에 대한 alert 경고 추가 #18
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
name: develop branch Build and Deploy to EC2 | |
on: | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
env: | |
BUCKET_NAME: hello-consultant | |
PROJECT_NAME: hello | |
DEPLOYMENT_GROUP_NAME: hello-consultant | |
CODE_DEPLOY_APP_NAME: code-deploy | |
jobs: | |
# 작업의 이름 | |
build_and_test: | |
# GitHub Actions 러너의 운영 체제 | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0.21 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: test | |
ports: | |
- 3306:3306 | |
mongodb: | |
image: mongo:latest | |
env: | |
MONGO_INITDB_ROOT_USERNAME: admin | |
MONGO_INITDB_ROOT_PASSWORD: admin | |
MONGO_INITDB_DATABASE: APP-DATABASE | |
ports: | |
- 27017:27017 | |
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=10 | |
# 순차적으로 실행될 단계들을 정의하는 섹션 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install mongosh | |
run: | | |
sudo apt-get install gnupg | |
wget -qO- https://www.mongodb.org/static/pgp/server-7.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-7.0.asc | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-mongosh | |
mongosh --version | |
- name: Initalize MongoDB | |
run: | | |
mongosh --host localhost:27017 -u admin -p admin --authenticationDatabase admin <<EOF | |
db = db.getSiblingDB('APP-DB'); | |
db.createUser({ user: 'APP-USERNAME', pwd: 'APP-PASSWORD', roles: [{ role: 'readWrite', db: 'APP-DB' }] }) | |
db.createCollection('APP-COLLECTION'); | |
EOF | |
# Do whatever you like in here | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Grant execute permission for gradlew | |
run: chmod +x ./gradlew | |
- name: Create application.yml | |
run: | | |
mkdir -p src/main/resources | |
mkdir -p src/test/resources | |
echo "${{ secrets.APPLICATION_YML_CONTENT }}" > src/main/resources/application.yml | |
echo "${{ secrets.APPLICATION_TEST_YML_CONTENT }}" > src/test/resources/application.yml | |
echo "${{ secrets.GCP_BUCKET_CONTENT }}" > src/main/resources/meritz-420004-93e56cbdf236.json | |
- name: Clean with gradle | |
run: ./gradlew clean | |
- name: Build with gradle | |
run: ./gradlew build |