add step to deploy docker image to droplet
This commit is contained in:
parent
98bd872dfb
commit
c922f4ecac
1 changed files with 16 additions and 0 deletions
16
.github/workflows/deploy.yml
vendored
16
.github/workflows/deploy.yml
vendored
|
|
@ -27,3 +27,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ secrets.DOCKER_USERNAME}}/${{ secrets.DOCKER_REPOSITORY }}:latest
|
tags: ${{ secrets.DOCKER_USERNAME}}/${{ secrets.DOCKER_REPOSITORY }}:latest
|
||||||
|
|
||||||
|
- name: Deploy to DO
|
||||||
|
uses: appleboy/ssh-action@v1.0.3
|
||||||
|
env:
|
||||||
|
IMAGE_PATH: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:latest
|
||||||
|
APP_NAME: ${{ secrets.DOCKER_REPOSITORY }}
|
||||||
|
PORT: ${{ secrets.PORT }}
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.DO_HOST }}
|
||||||
|
username: ${{ secrets.DO_USERNAME }}
|
||||||
|
key: ${{ secrets.DO_KEY }}
|
||||||
|
script: |
|
||||||
|
docker image pull $IMAGE_PATH
|
||||||
|
docker container stop $APP_NAME
|
||||||
|
docker container rm $APP_NAME
|
||||||
|
docker container run -d --name $APP_NAME -p $PORT:$PORT $IMAGE_PATH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue