Skip to content

run server

run server #17

name: run server
on:
workflow_run:
workflows:
- "release server"
types:
- completed
env:
DOCKER_IMAGE: gmlwh124/ajaja:latest
SERVER_NAME: ajaja-server
jobs:
run-server:
runs-on: ubuntu-latest
steps:
- name: pull image and rerun w/ ssh command
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
docker pull ${{ env.DOCKER_IMAGE }}
docker ps -aq --filter name=${{ env.SERVER_NAME }} | xargs docker stop | xargs docker rm
docker run --name ${{ env.SERVER_NAME }} --restart=always -dp 8080:8080 --network=ajaja-bridge ${{ env.DOCKER_IMAGE }}
docker images -q --filter dangling=true | xargs docker rmi