Deploy Project #4
Workflow file for this run
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 Project | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Rsync to prod server | |
uses: burnett01/[email protected] | |
with: | |
switches: -avzr --delete | |
path: ./ | |
remote_path: /home/git/${{ github.repository }}/${{ github.ref }} | |
remote_host: ${{ secrets.PROD_SERVER_HOST }} | |
remote_user: git | |
remote_password: ${{ secrets.SSH_USER_PASSWORD }} | |
remote_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: SSH into development server and run Docker Compose | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.PROD_SERVER_HOST }} | |
username: git | |
password: ${{ secrets.SSH_USER_PASSWORD }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/git/${{ github.repository }}/${{ github.ref }} | |
docker-compose up -d |