-
Notifications
You must be signed in to change notification settings - Fork 0
29 lines (24 loc) · 1.23 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
name: Deploy to Container
on:
push:
branches:
- 24_correction_coord
- 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 checkout . && git pull origin main && cd backend-laravel && php artisan db:wipe --force && php artisan migrate --force && php artisan db:seed --force && composer install && php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider" && php artisan l5-swagger:generate && cd ../frontend-vue && npm install && npm run build && (crontab -l && crontab -r) || echo '*/5 * * * * cd /home/laravel/project/Swissdle/backend-laravel && /usr/local/bin/php artisan schedule:run >> /home/laravel/project/Swissdle/cron.log' | crontab"