Skip to content

Deploy to Production #1

Deploy to Production

Deploy to Production #1

Workflow file for this run

name: Deploy to Production
on:
workflow_dispatch:
push:
branches:
- trunk
paths:
- 'app/src/**'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
- name: Add host key
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: Install Composer
uses: php-actions/composer@v6
with:
php_version: '8.3'
version: '2.8.4'
- name: Install composer dependencies
run: |
cd app
composer install --no-dev
cd ..
- name: Deploy to production
run: |
rsync -avz --delete app/src/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www/html/