-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (44 loc) · 1.41 KB
/
deploy-backend-dev.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
name: Upload backend to dev server and lint
on:
push:
branches:
- dev
pull_request:
branches:
- dev
env:
FLUTTER_VERSION: 3.10.1
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Upload PHP code
run: scp -o StrictHostKeyChecking=no -r * ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/julesartd/www/api-dev-edt-3il
install_dependencies:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: SSH Into Server and Install Composer Dependencies
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/julesartd/www/api-dev-edt-3il/backend
composer2 install
- name: SSH Into Server and execute Linter for PHP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/julesartd/www/api-dev-edt-3il/backend
vendor/bin/php-cs-fixer fix src