-
Notifications
You must be signed in to change notification settings - Fork 0
/
laravel-web-deploy.yml
70 lines (62 loc) · 1.82 KB
/
laravel-web-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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: FTP Upload
on:
push:
branches:
- main
jobs:
pre-deploy:
name: 🎉 Pre-Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Connect SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
passphrase: ${{ secrets.SSH_PASS }}
key: ${{ secrets.SSH_KEY }}
port: 22
command_timeout: 30m
script: |
cd public_html/
php artisan down
web-deploy:
name: 🎉 Deploy to Production
runs-on: ubuntu-latest
needs: pre-deploy
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v3
- name: 📂 Sync files
uses: SamKirkland/[email protected]
with:
server-dir: public_html/
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
protocol: ftp
port: 21
exclude: |
**/.git*
**/.git*/**
**/docker*/**
post-deploy:
name: 🎉 Post-Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
needs: web-deploy
steps:
- name: Connect SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
passphrase: ${{ secrets.SSH_PASS }}
key: ${{ secrets.SSH_KEY }}
port: 22
command_timeout: 30m
script: |
cd public_html/
php artisan up
# php artisan env:set BUILD_ID ${{ github.run_number }} # To use this, check out my package. Run 'composer require levizoesch/laravelsetenvironment' then you can run the artisan command 'php artisan env:set BUILD_ID 1.15.86'