서포터 피드백 작성 유무 반환 추가, 러너 게시글 조회수 flyway 컬럼명 수정, 서포터 지원자 수 조회시 dto 사용하도… #109
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: dev/BE CD on Push | |
on: | |
push: | |
branches: [ "dev/BE" ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.SUBMODULE_BE_TOKEN }} | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Build with Gradle | |
uses: gradle/[email protected] | |
- name: Execute Gradle build | |
run: | | |
cd backend/baton | |
./gradlew build | |
- name: Setup Docker buildx | |
uses: docker/[email protected] | |
- name: Login to Docker Hub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_DEV_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_DEV_TOKEN }} | |
- name: Docker Image Build | |
run: | | |
cd backend/baton | |
docker build --platform linux/arm64/v8 -t 2023baton/2023baton -f Dockerfile-dev . | |
- name: Docker Hub Push | |
run: docker push 2023baton/2023baton | |
deploy: | |
runs-on: [ self-hosted, Linux, ARM64, dev ] | |
needs: build | |
steps: | |
- name: Pull Latest Docker Image | |
run: | | |
sudo docker login --username ${{ secrets.DOCKERHUB_DEV_USERNAME }} --password ${{ secrets.DOCKERHUB_DEV_TOKEN }} | |
if sudo docker inspect spring-baton &>/dev/null; then | |
sudo docker stop spring-baton | |
sudo docker rm -f spring-baton | |
sudo docker image prune -af | |
fi | |
sudo docker pull 2023baton/2023baton:latest | |
- name: Docker Compose | |
run: | | |
sudo docker run --name spring-baton --network=baton -p 8080:8080 -e TZ=Asia/Seoul 2023baton/2023baton:latest 1>> build.log 2>> error.log & |