File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1414 default : ' deploy'
1515 type : choice
1616 options :
17+ - build
1718 - deploy
19+ - swarm-deploy
1820 - restart
1921 - rollback
2022
3739 name : env-file
3840 path : env-file
3941 build :
40- if : ${{ github.event.inputs.command == 'deploy' }}
42+ if : ${{ github.event.inputs.command == 'deploy' }} || ${{ github.event.inputs.command == 'build' }} || ${{ github.event.inputs.command == 'swarm-deploy' }}
4143 runs-on : ubuntu-latest
4244 env :
4345 DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
@@ -104,3 +106,16 @@ jobs:
104106 docker stop ceramicraft-user-mservice || true
105107 docker rm ceramicraft-user-mservice || true
106108 docker run -d --name ceramicraft-user-mservice --network ceramicraft-network -v /home/ubuntu/logs:/app/logs --env-file env-file "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}"
109+ swarm-deploy :
110+ if : ${{ github.event.inputs.command == 'swam-deploy' }}
111+ runs-on : self-hosted
112+ needs : build
113+ env :
114+ DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_HUB_USERNAME }}
115+ steps :
116+ - name : pull the docker image
117+ run : |
118+ docker pull "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}"
119+ - name : update the service
120+ run : |
121+ docker service update --force --image "${DOCKER_HUB_USERNAME}/ceramicraft-user-mservice:${{ github.event.inputs.version }}" ms-stack_user-ms || true
You can’t perform that action at this time.
0 commit comments