Skip to content

Merge branch 'dev' of github.com:LikelionUniv/Server into stag/admin #16

Merge branch 'dev' of github.com:LikelionUniv/Server into stag/admin

Merge branch 'dev' of github.com:LikelionUniv/Server into stag/admin #16

name: stag-admin-api-deploy
on:
push:
branches: [ "stag/admin" ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: app clean
run: ./gradlew clean
- name: admin api build
run: ./gradlew :likelion-admin:build -x test
- name: Docker login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_EMAIL }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./likelion-admin
push: true
tags: ${{ secrets.DOCKER_ADMIN_API_STAG_IMAGE }}
build-args: PROFILE=stag
- name: admin-api-deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.KEY }}
script: |
sudo docker rm -f ${{ secrets.DOCKER_ADMIN_API_STAG_CONTAINER }}
sudo docker rmi ${{ secrets.DOCKER_ADMIN_API_STAG_IMAGE }}
sudo docker-compose -f ${{ secrets.DOCKER_COMPOSE_DIRECTORY }} up -d
sudo docker image prune -f