Skip to content

Commit

Permalink
fix: cicd 시기 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ay-eonii committed Jul 25, 2024
1 parent 06f1ebd commit f5b105b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/cd-dev.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/cicd-backend-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI CD dev

on:
push:
branches:
- develop-backend

jobs:
build:
runs-on: ubuntu-24.04

defaults:
run:
shell: bash
working-directory: ./backend

steps:
- name: 레포지토리 체크아웃
uses: actions/checkout@v4

- name: JDK 17을 설치
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'

- name: gradlew 권한 부여
run: chmod +x ./gradlew

- name: Gradle 빌드
run: ./gradlew clean build

- name: DockerHub 로그인
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: 도커 이미지 빌드 및 푸시
run: |
docker buildx build ./ --platform=linux/arm64 -t 2024mouda/mouda-be:latest
docker push 2024mouda/mouda-be:latest
deploy:
needs: build
runs-on: self-hosted

steps:
- name: change permission
run: |
sudo chown -R ubuntu:ubuntu /home/ubuntu/actions-runner/_work/2024-mouda
- name: DockerHub login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker Compose up
run: |
docker compose -f ./backend/docker-compose.yml down mouda-be
docker compose -f ./backend/docker-compose.yml pull mouda-be
docker compose -f ./backend/docker-compose.yml up -d mouda-be

0 comments on commit f5b105b

Please sign in to comment.