-
Notifications
You must be signed in to change notification settings - Fork 5
45 lines (39 loc) · 1.59 KB
/
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
#Build the application
name: Build without E2E tests
on:
pull_request: {}
push:
branches: [master]
workflow_dispatch: # for running action manually
env:
# These must be set for fetchdep.sh to get the right branch
REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
# Only run on draft PRs. On ready_for_review PRs, we already have the Cypress job which runs the build
if: github.event.pull_request.draft == true
steps:
- uses: actions/checkout@v4
- name: Get Node Version
id: node_version
run: echo ::set-output name=node_version::$(node -e 'console.log(require("./package.json").engines.node)')
- uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: ${{ steps.node_version.outputs.node_version }}
- name: Install Dependencies
run: "yarn install"
- name: "Copy the config file at the right place"
run: "cp config.dev.json config.json" # todo we could make the choice of backend configurable.
- name: Build
run: "yarn build"
- name: Upload build in artifact
uses: actions/upload-artifact@v3
with:
name: devbuild # because we used the dev config file
path: webapp
# We'll only use this in a triggered job, then we're done with it
retention-days: 1