-
Notifications
You must be signed in to change notification settings - Fork 38
62 lines (54 loc) · 1.59 KB
/
build-project.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
# SPDX-FileCopyrightText: 2022 Alliander N.V.
#
# SPDX-License-Identifier: Apache-2.0
name: Build Project
on:
push:
branches:
- '**'
pull_request:
branches:
- 'main'
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/[email protected]
- name: Cache Docker Register
if: ${{ github.event_name == 'pull_request' }}
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
- name: Set up Docker Buildx
id: buildx
if: ${{ github.event_name == 'pull_request' }}
uses: docker/setup-buildx-action@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v4
with:
node-version: '14.x'
- name: Test application with npm
timeout-minutes: 45
if: ${{ github.event_name == 'push' }}
run: |
cd packages/compas-open-scd
npm ci
npm run-script test
- name: Build application with npm
if: ${{ github.event_name == 'pull_request' }}
timeout-minutes: 45
run: |
cd packages/compas-open-scd
npm ci
npm run-script build
- name: Build docker image
if: ${{ github.event_name == 'pull_request' }}
uses: docker/build-push-action@v5
with:
# Set the context to use the packages/compas-open-scd directory and not execute it's own git checkout.
context: packages/compas-open-scd
push: false