-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (43 loc) · 1.32 KB
/
frontend-prod-cd.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
name: Frontend Production Deploy (CD)
on:
workflow_dispatch:
jobs:
build:
name: Frontend Deploy
runs-on: shook-prod
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Setting env
shell: bash
run: |
rm -rf frontend/.env
mkdir frontend/.env
echo "BASE_URL=${{ secrets.FRONT_PROD_BASE_URL }}" > frontend/.env/.env.production
- name: Cache dependencies
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.cache-name }}-
${{ runner.os }}-node-
${{ runner.os }}-
- name: Install Dependencies
shell: bash
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: npm ci
working-directory: ./frontend
- name: Build files
shell: bash
run: npm run build
working-directory: ./frontend
- name: Remove legacy static pages
shell: bash
run: rm -rf home/ubuntu/dist
- name: Move generated new static pages
shell: bash
run: cp -r frontend/dist ~/