Skip to content

removed crontab entries only if there are entries #49

removed crontab entries only if there are entries

removed crontab entries only if there are entries #49

Workflow file for this run

name: Deploy to Container
on:
push:
branches:
- 17_schedule_and_swagger
- main
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to Container
run: |
mkdir ~/.ssh
touch ~/.ssh/known_hosts
touch ~/.ssh/pkey
ssh-keyscan -p ${{ secrets.SECRET_PORT }} ${{ secrets.SECRET_HOST }} >> ~/.ssh/known_hosts
echo "${{ secrets.SECRET_PRIVATE_SSH }}" > ~/.ssh/pkey
chmod 600 ~/.ssh/pkey
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/pkey
ssh ${{ secrets.SECRET_USER }}@${{ secrets.SECRET_HOST }} -p ${{ secrets.SECRET_PORT }} "cd ./project/Swissdle && git pull origin main && cd backend-laravel && composer install && cd ../frontend-vue && npm install && npm run build && crontab -l >/dev/null 2>&1 && crontab -r && echo '* * * * * cd /home/laravel/project/Swissdle/backend-laravel && php artisan schedule:run >> /home/laravel/project/Swissdle/cron.log' | crontab -e"