Deploy #5
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_run: | |
workflows: | |
- "Publish Vue Frontend Skeleton to GHCR" | |
- "Publish Vue Backend Skeleton to GHCR" | |
types: | |
- completed | |
branches: | |
- "main" | |
push: | |
branches: | |
- "main" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' || | |
github.event_name == 'push' | |
steps: | |
- name: executing remote ssh commands using ssh key | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
port: ${{ secrets.PORT }} | |
script: | | |
docker stop $(docker ps -q) | |
docker rm $(docker ps -aq) | |
docker compose pull && docker compose up -d |