update: make docker autostart & forece recreate on deploy #87
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
# workflow_run: | |
# workflows: ["Test"] | |
# types: | |
# - completed | |
pull_request: | |
types: | |
- closed | |
jobs: | |
deploy: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cloning repo | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Deploy to vps | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: 22 | |
command_timeout: 30m | |
script: | | |
cd image-optimizer | |
git pull origin master | |
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --no-deps --build --force-recreate |