File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1- name : Create and publish a Docker image
1+ name : Continuous Deployment
22
33on :
44 push :
1010
1111jobs :
1212 build_image :
13+ name : Build Image
1314 runs-on : ubuntu-latest
1415 permissions :
1516 contents : read
4546 subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
4647 subject-digest : ${{ steps.push.outputs.digest }}
4748 push-to-registry : true
48-
49+ deploy :
50+ runs-on : ubuntu-latest
51+ name : Deploy
52+ steps :
53+ - name : Checkout repository
54+ uses : actions/checkout@v4
55+ - name : Setup SSH
56+ uses : appleboy/ssh-action@v1.2.1
57+ env :
58+ SECRETS_FILE : ${{ secrets.SECRETS }}
59+ with :
60+ host : ${{ secrets.SSH_HOST }}
61+ username : ${{ secrets.SSH_USERNAME }}
62+ key : ${{ secrets.SSH_KEY }}
63+ port : ${{ secrets.SSH_PORT }}
64+ envs : SECRETS_FILE
65+ script_path : deploy.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ mkdir -p projects && cd projects
4+
5+ if [ -d " common-game" ]; then
6+ cd common-game
7+ git pull
8+ else
9+ git checkout https://github.com/cg219/common-game.git common-game
10+ cd common-game
11+ fi
12+
13+ echo $SECRETS_FILE > secrets.yaml
14+ docker stack deploy -c stack.yaml commongame
You can’t perform that action at this time.
0 commit comments