Skip to content

[ALL] docs: README 문서에 기능 동작 모습이 담긴 gif 파일을 추가한다. (#962) #3

[ALL] docs: README 문서에 기능 동작 모습이 담긴 gif 파일을 추가한다. (#962)

[ALL] docs: README 문서에 기능 동작 모습이 담긴 gif 파일을 추가한다. (#962) #3

name: ✨ StampCrush backend DEV CD ✨
env:
DOCKER_HUB_REPOSITORY: stampcrush/stampcrush-dev
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- "backend/**"
jobs:
backend-docker-build-and-push:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- name: ✨ Checkout repository
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.ACTION_TOKEN }}
- name: ✨ JDK 17 설정
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: ✨ Gradle Caching
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: ✨ Gradlew 권한 설정
run: chmod +x ./gradlew
- name: ✨ Jar 파일 빌드
run: ./gradlew bootJar
- name: ✨ DockerHub에 로그인
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: ✨ Docker Image 빌드 후 DockerHub에 Push
uses: docker/build-push-action@v4
with:
context: ./backend
file: ./backend/Dockerfile-dev2
push: true
platforms: linux/arm64
tags: ${{ env.DOCKER_HUB_REPOSITORY }}:latest
backend-docker-pull-and-run:
runs-on: [self-hosted, dev]
if: ${{ needs.backend-docker-build-and-push.result == 'success' }}
needs: [ backend-docker-build-and-push ]
steps:
- name: ✨ 배포 스크립트 실행
run: |
sh /home/ubuntu/deploy.sh