-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript-build-api.yml
More file actions
46 lines (43 loc) · 1.25 KB
/
javascript-build-api.yml
File metadata and controls
46 lines (43 loc) · 1.25 KB
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
# This action will run an action in the "./api" directory of your repo.
# It will then upload relevant artifacts under the name "api"
# This solution is developed with Azure Static Web Apps functions in mind.
name: Build API
on:
workflow_call:
inputs:
api-artifact-name:
required: false
type: string
default: "api"
description: "The name of the API artifact"
jobs:
run:
name: Build API
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Install modules
working-directory: ./api
run: yarn install
- name: Build api
working-directory: ./api
run: |
yarn run build
# We need to include the entire directory, node_modules and all,
# since Azure won't grab these modules
- name: Compressing API Artifact
working-directory: ./api
run: |
tar -cvf ./api.tar .
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.api-artifact-name }}
path: ./api/api.tar