Skip to content

Merge pull request #5 from ThomasLdev/test/ci_steps #2

Merge pull request #5 from ThomasLdev/test/ci_steps

Merge pull request #5 from ThomasLdev/test/ci_steps #2

Workflow file for this run

name: Instabot Deployment
on:
push:
branches:
- main
release:
types: [ published ]
jobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rsync files to Server
run: |
rsync -avz --exclude '/vendor' --exclude '/node_modules' --exclude '/var' ./ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_TARGET }}
- name: Install dependencies and compile assets on prod server
run: |
ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} -p 22 << EOF
cd ${{ secrets.REMOTE_TARGET }}
composer install --no-dev --optimize-autoloader
php bin/console cache:clear --no-warmup --env=prod
php bin/console cache:warmup --env=prod
EOF