Skip to content

re-run server

re-run server #2

name: pull docker image, re-run container
on:
workflow_run:
workflows:
- "generate docker image, upload to docker hub"
types:
- completed
jobs:
rerun-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 gmlwh124/ajaja:latest
docker ps -aq | xargs docker stop | xargs docker rm
docker run -d -p 8080:8080 gmlwh124/ajaja:latest