forked from Rubix98/algodebug
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.32 KB
/
deploy_frontend.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
name: Deploy Frontend
on: [workflow_dispatch]
jobs:
deploy_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: "Install dependencies"
run: npm ci
working-directory: "./frontend"
- name: "Build"
run: npm run build
working-directory: "./frontend"
- name: "Pack the project into an archive"
run: mkdir packedDist && tar -cf ./packedDist/frontend.tar -C ./dist .
working-directory: "./frontend"
- name: "Deploy built project on VPS"
uses: wangyucode/sftp-upload-action@main
with:
host: "${{ secrets.SFTP_ADDRESS }}"
port: "${{ secrets.SFTP_PORT }}"
username: "${{ secrets.SFTP_USERNAME }}"
password: "${{ secrets.SFTP_PASSWORD }}"
localDir: "./frontend/packedDist"
remoteDir: "/home/${{ secrets.SFTP_USERNAME }}/gh/"
dryRun: false
- name: "Run deploy script on server"
uses: garygrossgarten/github-action-ssh@release
with:
command: "bash deploy_www.sh"
host: "${{ secrets.SFTP_ADDRESS }}"
port: "${{ secrets.SFTP_PORT }}"
username: "${{ secrets.SFTP_USERNAME }}"
password: "${{ secrets.SFTP_PASSWORD }}"