File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Docker Build & Push and Deploy to prod for eatery-blue-backend
1+ name : Docker Build & Push and Deploy to prod for eatery-prod
22
33on :
44 push :
@@ -34,27 +34,18 @@ jobs:
3434 push : true
3535 tags : cornellappdev/eatery-prod:${{ steps.vars.outputs.sha_short }}
3636
37- - name : Deploy with Native SSH
37+ - name : Remote SSH and Deploy
38+ uses : appleboy/ssh-action@v1.0.3
3839 env :
39- PRIVATE_KEY : ${{ secrets.PROD_SERVER_KEY }}
40- HOST : ${{ secrets.PROD_SERVER_HOST }}
41- REMOTE_USER : ${{ secrets.SERVER_USERNAME }}
4240 IMAGE_TAG : ${{ steps.vars.outputs.sha_short }}
43- run : |
44- mkdir -p ~/.ssh
45- chmod 700 ~/.ssh
46-
47- # Safely write the key and strip any invisible Windows carriage returns
48- echo "$PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
49- chmod 600 ~/.ssh/id_rsa
50-
51- ssh-keyscan -H "$HOST" >> ~/.ssh/known_hosts
52-
53- ssh -v -o PubkeyAcceptedKeyTypes=+ssh-rsa -i ~/.ssh/id_rsa "$REMOTE_USER@$HOST" "
54- export IMAGE_TAG=$IMAGE_TAG
41+ with :
42+ host : ${{ secrets.PROD_SERVER_HOST }}
43+ username : ${{ secrets.SERVER_USERNAME }}
44+ key : ${{ secrets.PROD_SERVER_KEY }}
45+ script : |
46+ export IMAGE_TAG=${{ steps.vars.outputs.sha_short }}
5547 cd docker-compose
5648 docker stack rm thestack
57- sleep 20
49+ sleep 20s
5850 docker stack deploy -c docker-compose.yml thestack
59- docker system prune -af
60- "
51+ yes | docker system prune -a
You can’t perform that action at this time.
0 commit comments