Skip to content

docker-image.yml 변경 #11

docker-image.yml 변경

docker-image.yml 변경 #11

Workflow file for this run

name: Docker Image CI
on:
push:
branches: ["develop"]
jobs:
CI-CD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
- name: Build with Gradle
run: ./gradlew build -x test
- name: Docker build & push
if: contains(github.ref, 'develop')
run: |
docker login -u yooonwodyd00 -p dbswodyd91
docker build -f Dockerfile -t yooonwodyd00/happynewhere_be-app .
docker push yooonwodyd00/happynewhere_be-app
## deploy to develop
- name: Deploy to dev
if: contains(github.ref, 'develop')
uses: appleboy/ssh-action@master
with:
host: 210.89.188.107
username: root
password: D8N9!79t3u
port: 3306
script: |
sudo docker ps
sudo docker pull yooonwodyd00/happynewhere_be-app
sudo docker compose down
sudo docker compose up -d