-
Notifications
You must be signed in to change notification settings - Fork 0
/
client-build.yml
62 lines (56 loc) · 1.77 KB
/
client-build.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
# This action will build a JavaScript/TypeScript frontend application and upload the relevant artifacts.
# Note: This action was developed with Azure Static Web Apps in mind. Remove lines 55 to 57 if not for Azure Static Web Apps.
# Example of usage:
# build-client:
# name: Build Client
# needs: [unit-tests, es-lint]
# uses: ./.github/workflows/build-client.yml
name: Build client
on:
workflow_call:
inputs:
artifact-name:
description: "The name of the client artifact"
required: false
type: string
default: "client-artifact"
node-version:
description: "The version of Node"
required: false
type: string
default: "16.x"
runs-on:
required: false
type: string
default: "ubuntu-latest"
description: "The hosted runner"
jobs:
run:
name: Build client
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: "yarn"
- name: Install modules
run: yarn install
- name: Build client
run: yarn run build
# Copy the staticwebapp.config.json file into the dist directory
# This must be included in the 'app' directory for SWA to know
# our configuration details.
# This is only relevant if you are running a static web app.
# Remove if not needed.
- name: Copy staticwebapp.config.json
run: |
cp staticwebapp.config.json dist/
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact-name }}
path: dist