File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 server_ssh_port :
3838 description : ' The SSH key to use to connect to the server'
3939 required : true
40- local_host :
41- description : ' The IP address of the host machine'
42- required : false
4340
4441jobs :
4542 deploy :
6764 DOCKER_IMAGE : ${{ inputs.docker_user }}/${{ inputs.image_name }}
6865 DOCKER_TAG : latest
6966 CONTAINER_NAME : ${{ inputs.image_name }}_container
70- JUMP_HOST : " ${{ inputs.deployment_user }}@${{ inputs.server_hostname }}:${{ secrets.server_ssh_port }}"
71- DEPLOY_HOST : ${{ secrets.local_host }}
67+ DEPLOY_HOST : " ${{ inputs.deployment_user }}@${{ inputs.server_hostname }}"
7268 run : |
73- ssh -J ${{ env.JUMP_HOST }} ${{ inputs.deployment_user }}@${ DEPLOY_HOST:-localhost} 'docker pull ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}'
74- ssh -J ${{ env.JUMP_HOST }} ${{ inputs.deployment_user }}@${ DEPLOY_HOST:-localhost} 'docker stop ${{ env.CONTAINER_NAME }} || true'
75- ssh -J ${{ env.JUMP_HOST }} ${{ inputs.deployment_user }}@${ DEPLOY_HOST:-localhost} 'docker rm ${{ env.CONTAINER_NAME }} || true'
76- ssh -J ${{ env.JUMP_HOST }} ${{ inputs.deployment_user }}@${ DEPLOY_HOST:-localhost} 'docker run --restart unless-stopped -d --name ${{ env.CONTAINER_NAME }} -p ${{ inputs.host_port }}:${{ inputs.host_port }}/tcp --env-file .env ${{ inputs.docker_args }} ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}'
69+ ssh -p ${{ secrets.server_ssh_port }} $DEPLOY_HOST 'docker pull ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}'
70+ ssh -p ${{ secrets.server_ssh_port }} $DEPLOY_HOST 'docker stop ${{ env.CONTAINER_NAME }} || true'
71+ ssh -p ${{ secrets.server_ssh_port }} $DEPLOY_HOST 'docker rm ${{ env.CONTAINER_NAME }} || true'
72+ ssh -p ${{ secrets.server_ssh_port }} $DEPLOY_HOST 'docker run --restart unless-stopped -d --name ${{ env.CONTAINER_NAME }} -p ${{ inputs.host_port }}:${{ inputs.host_port }}/tcp --env-file .env ${{ inputs.docker_args }} ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}'
Original file line number Diff line number Diff line change @@ -55,8 +55,3 @@ You must set up the following secrets in your GitHub repository to securely stor
5555
5656- Description: The SSH port to use to connect to the server.
5757- Example: ` 22 `
58-
59- ` local_host ` (Optional):
60-
61- - Description: The local host to use to connect to the server. Defaults to ` localhost ` .
62- - Example: ` 172.123.0.53 `
You can’t perform that action at this time.
0 commit comments