-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.3 KB
/
frontend-deploy.yaml
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
name: Frontend deploy
on:
push:
branches:
- main
paths:
- "frontend/**"
- ".github/workflows/frontend-deploy.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 21
- name: Generate from OpenApi spec
run: npm --prefix ./api install; npm --prefix ./api run generate-ts -y
- name: Install dependencies
run: npm --prefix ./frontend install
- name: Build
run: npm --prefix ./frontend run build
- name: Remove old artifacts
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
script: rm -rf /opt/swimlogs/dist/*
- name: Deploy new artifacts
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
source: frontend/dist/*
target: /opt/swimlogs/
strip_components: 1