Skip to content

fix: 대학목록 페이지 커스텀화 #70

fix: 대학목록 페이지 커스텀화

fix: 대학목록 페이지 커스텀화 #70

Workflow file for this run

name: Docker CI/CD
on:
push:
branches:
- deploy
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
CI: false
steps:
- name: 🗃️ Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Check out source code
uses: actions/checkout@v2
- name: 📦️ Setup JDK 11.0.12
uses: actions/setup-java@v1
with:
java-version: 11.0.12
- name: 💾 Cache Gradle & Spring
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: make application-db.properties
run: |
cd ./src/main/resources
touch ./application-db.properties
echo "${{ secrets.DB_PROPERTIES }}" > ./application-db.properties
shell: bash
- name: make application-mail.properties
run: |
cd ./src/main/resources
touch ./application-mail.properties
echo "${{ secrets.MAIL_PROPERTIES }}" > ./application-mail.properties
shell: bash
- name: 🔧 Build Spring server
run: |
chmod +x ./gradlew
./gradlew clean build -x test
- name: 📦️ Setup NodeJS 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install modules
working-directory: ./univcert-web
run: |
ls -al
pwd
whoami
npm install
- name: 🔧 npm run build
working-directory: ./univcert-web
run: npm run build
- name: Deploy Prod use SCP [Spring]
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST_DEV }}
key: ${{ secrets.PRIVATE_KEY }}
source: "./build/libs/*.jar"
target: "/home/ec2-user/deploy"
strip_components: 2
- name: Deploy Prod use SCP [React]
uses: appleboy/scp-action@master
with:
username: ec2-user
host: ${{ secrets.HOST_DEV }}
key: ${{ secrets.PRIVATE_KEY }}
source: "./univcert-web/build/*"
target: "/home/ec2-user/deploy/front"
strip_components: 2
- name: Execute Server/Front Init Script
uses: appleboy/ssh-action@master
id: deploy-prod
with:
host: ${{ secrets.HOST_DEV }}
username: ec2-user
key: ${{ secrets.PRIVATE_KEY }}
port: 22
envs: GITHUB_SHA
script: |
cd deploy
docker container stop univcert
docker container stop univcert-web
docker build -t univcert-docker .
docker run -d --rm -p 8080:8080 --name univcert univcert-docker
cd front
docker build -t univcert-web .
docker run -d --rm -it -p 3000:3000 --name univcert-web univcert-web