Merge branch 'main' into develop #190
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: Admin CI/CD | |
on: | |
push: | |
branches: [ "develop" ] | |
paths-ignore: | |
- 'application/api/**' # application/api 폴더 내의 변화 무시 | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup jdk 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: build with gradle | |
working-directory: ./backend | |
run: ./gradlew bootJar | |
- name: push to dockerhub | |
working-directory: ./backend | |
run: | | |
docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }} | |
docker build --no-cache -t ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_ADMIN_REPO }} -f ./application/admin/Dockerfile . | |
docker push ${{ secrets.DOCKER_ID }}/${{ secrets.DOCKER_ADMIN_REPO }} | |
- name: deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
port: ${{ secrets.SSH_PORT }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
script: | | |
${{ secrets.SSH_SCRIPT_FOR_ADMIN }} |