-
Notifications
You must be signed in to change notification settings - Fork 0
/
workflow.yml
62 lines (50 loc) · 1.78 KB
/
workflow.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
name: Laravel Auto Deployment
on:
push:
branches:
- branch-name
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: "npm"
- name: Install NPM dependencies
run: npm install
- name: Compiling assets
run: npm run build
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: js-dist
path: public/build
deploy:
runs-on: ubuntu-24.04
needs: [build]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Download js build
uses: actions/download-artifact@v4
with:
name: js-dist
- name: Install laravel envoy
uses: php-actions/composer@v6
with:
args: --ignore-platform-reqs
command: require laravel/envoy --dev
- name: Adding staging server key
run: |
echo "${{ secrets.DEV_PRIVATE_KEY }}" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H "app.checkypro.com" > ~/.ssh/known_hosts
- name: Deploying to staging server
run: ./vendor/bin/envoy run deploy
- name: Creating js build folder
run: mkdir build && cp -R assets/ manifest.json build
- name: Copying JS build to server
run: scp -r build/ dev@checkypro.robustapps.net:/var/www/checkypro/current/public/