-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.81 KB
/
main.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
name: Deploy to SFTP
on:
push:
branches:
- master # Change this to your target branch
jobs:
deploy-backend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update packages and install lftp
run: |
sudo apt-get update
sudo apt-get install -y lftp
# - name: Set environment variable
# run: echo "FRONTEND_URL=${{ secrets.VUE_APP_FITMO_FRONTEND_URL }}" >> Fitmo_backend/.env
- name: Deploy Backend via SFTP
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
run: |
lftp -e "set ssl:verify-certificate no; open -u $FTP_USERNAME,$FTP_PASSWORD 287586.w86.wedos.net && mirror -R Fitmo_backend /www/subdom/be"
deploy-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Update packages and install lftp
run: |
sudo apt-get update
sudo apt-get install -y lftp
- name: Navigate to frontend directory and install dependencies
run: |
cd Fitmo_frontend
npm install
- name: Set environment variable
run: echo "VUE_APP_FITMO_BACKEND_URL=${{ secrets.VUE_APP_FITMO_BACKEND_URL }}" >> Fitmo_frontend/.env
- name: Build Frontend
run: |
cd Fitmo_frontend
npm run build
- name: Deploy Frontend via SFTP
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
run: |
cd Fitmo_frontend/dist # Navigate to the build output directory
lftp -e "set ssl:verify-certificate no; open -u $FTP_USERNAME,$FTP_PASSWORD 287586.w86.wedos.net && mirror -R . /www/subdom/dev"