Skip to content

Deploy to Server

Deploy to Server #208

Workflow file for this run

name: Deploy to Server
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.ref == 'refs/heads/main' && 'uat' || 'dev' }}
url: https://${{ github.ref == 'refs/heads/main' && 'uat' || 'dev' }}.puc.cartong.org
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to Server depending on environment
run: |
ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
"cd ${{ secrets.REMOTE_PATH }} && git fetch origin && git reset --hard origin/${{ github.ref_name }} && make deploy && make rerun-database"