-
Notifications
You must be signed in to change notification settings - Fork 14
113 lines (91 loc) · 3.66 KB
/
docker.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: docker
on:
workflow_dispatch:
inputs:
dryRun:
description: 'Dry run (do not push containers to the registry): true / false'
required: true
default: 'false'
defaults:
run:
shell: bash
concurrency:
group: ${{ github.head_ref }}.${{ github.sha }}.docker
cancel-in-progress: true
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Print inputs
run: |
echo "Deployment Environment: ${{ github.event.inputs.dryRun }}"
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Don't save Bash session history
run: unset HISTFILE
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Configure kernel (increase watchers)
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Use yarn 1.22.17 (required for integrity check)
run: yarn set version 1.22.17 # this is mandatory, yarn v2 does not have integrity check which is needed for the pipeline
- name: Get variables (yarn cache directory path, commit hash)
id: get-variables
run: echo "::set-output name=yarncachedir::$(yarn cache dir)"; echo "::set-output name=commitsha::$(echo ${GITHUB_SHA})"
- name: Workspace cache (npm, yarn, nx, jest)
uses: actions/cache@v2
id: workspace-cache # use this to check for `cache-hit` (`steps.workspace-cache.outputs.cache-hit != 'true'`)
env:
cache-name: workspace-cache
with:
path: |
~/.npm
${{ steps.get-variables.outputs.yarncachedir }}
**/node_modules
/tmp/nx
/tmp/jest_rs
./angular
key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-workspace-${{ steps.get-variables.outputs.commitsha }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-workspace-
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
${{ runner.os }}-
- name: Install global dependencies
run: npm i -g @compodoc/compodoc
- name: Workspace integrity check
run: yarn workspace:integrity-check
- name: Install project dependencies
run: yarn install:ci
- name: Unit test all (with code coverage)
run: |
npx nx run-many --target=test --all --pass-with-no-tests --code-coverage=true --watch=false --run-in-band --ci
ng run tools:coverage-stats
cat ./tools/ts/UNIT_COVERAGE.md
- name: Build all (production)
run: |
yarn generate:env:documentation
npx nx run-many --target=build --all --configuration production
- name: Build documentation (compodoc, unit coverage, e2e coverage)
run: |
yarn test:reports
ng run tools:compodoc-build
yarn generate:changelog
yarn e2e:headless:report
- name: Docker build apps
run: |
yarn docker:build api development
yarn docker:build client development
yarn docker:build elements development
yarn docker:build documentation
- name: Docker push apps
if: github.event.inputs.dryRun == 'false'
run: echo "TODO - Push docker images to the regitry"