fix auto deploy #9
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
on: | |
workflow_run: | |
workflows: ["Build and Push to Docker Hub"] | |
types: | |
- completed | |
jobs: | |
run_pull: | |
name: run pull | |
runs-on: ubuntu-latest | |
steps: | |
- name: install ssh keys | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
run: cd ${{ secrets.WORK_DIR }} && docker-compose stop && docker rm $(docker ps -aq) && docker rmi $(docker image ls -q) && docker-compose pull && docker-compose up -d && exit | |
- name: cleanup | |
run: rm -rf ~/.ssh |