File tree Expand file tree Collapse file tree 2 files changed +21
-31
lines changed
Expand file tree Collapse file tree 2 files changed +21
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- #
2- name : Create and publish a Docker image
1+ name : Publish a Docker image / SSH Deploy
32
43# Configures this workflow to run every time a change is pushed to the branch called `release`.
54on :
6059 subject-digest : ${{ steps.push.outputs.digest }}
6160 push-to-registry : true
6261
62+ SSH-Deploy :
63+ runs-on : ubuntu-latest
64+ needs : build-and-push-image
65+ steps :
66+ - name : executing remote ssh commands using password
67+ 68+ with :
69+ host : ${{ secrets.SSH_HOST }}
70+ username : ${{ secrets.SSH_USERNAME }}
71+ password : ${{ secrets.SSH_PASSWORD }}
72+ port : ${{ secrets.SSH_PORT }}
73+ script : |
74+ IMAGE_ID=ghcr.io/${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
75+ docker pull $IMAGE_ID:latest
76+ docker stop codepoker-be
77+ docker rm codepoker-be
78+ docker run -d --name codepoker-be \
79+ -p ${{ secrets.SSH_PORT }}:${{ secrets.SSH_PORT }} \
80+ --restart=always \
81+ $IMAGE_ID:latest
You can’t perform that action at this time.
0 commit comments