-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (53 loc) · 1.55 KB
/
deploy-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
name: Deployment (Develop)
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
environment: develop
steps:
- name: Repository checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Retrive caches
uses: actions/cache@v4
with:
path: node_modules
key: ${{ hashFiles('yarn.lock') }}
- name: Enable corepack
run: corepack enable
- name: Install project
run: yarn install --immutable
- name: Build
run: yarn build
env:
VITE_API_URL: ${{ vars.VITE_API_URL }}
VITE_REDIRECT_URI: ${{ vars.VITE_REDIRECT_URI }}
VITE_REST_API_KEY: ${{ secrets.VITE_REST_API_KEY }}
- name: Compress build artifacts
run: tar -cvf ./dist.tar ./dist
- name: Upload with SCP
uses: appleboy/scp-action@v0.1.7
with:
username: ubuntu
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
source: "dist.tar"
target: "/home/ubuntu/"
- name: Extract artifact with SSH
uses: appleboy/ssh-action@v1.2.0
with:
username: ubuntu
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
script: |
tar -xvf ./dist.tar ./dist
sudo rm -rf /var/www/homepage-frontend
sudo mv ./dist /var/www/homepage-frontend
rm -rf ./dist
rm -f ./dist.tar