Deploy Project #14
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: SSH into development server and mkdir | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets.PROD_SERVER_HOST }} | |
username: git | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
mkdir -p /home/git/${{ github.repository }}/${{ github.ref_name }} | |
- name: Rsync to prod server | |
uses: burnett01/rsync-deployments@6.0.0 | |
with: | |
switches: -avzr --delete | |
path: ./ | |
remote_path: /home/git/${{ github.repository }}/${{ github.ref_name }} | |
remote_host: ${{ secrets.PROD_SERVER_HOST }} | |
remote_user: git | |
remote_key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: SSH into development server and run Docker Compose | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets.PROD_SERVER_HOST }} | |
username: git | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
cd /home/git/${{ github.repository }}/${{ github.ref_name }} | |
docker compose up -d |