-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (146 loc) · 5.26 KB
/
ci.yaml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
# SPDX-FileCopyrightText: © 2022 Sebastian Davids <[email protected]>
# SPDX-License-Identifier: Apache-2.0
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# https://docs.ionos.space/docs/github-actions-customization/
# https://docs.ionos.space/docs/git-integration/#v1-projects-created-until-112022
name: ci
on: # yamllint disable-line rule:truthy
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
# unfortunately each job is billed for at least 1 minute in GH Actions
# so use one big one to save GH Action minutes
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions
lint-build-deploy:
runs-on: ubuntu-22.04
permissions:
contents: read
defaults:
run:
working-directory: hp
timeout-minutes: 10
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
uses: actions/[email protected]
- name: Classify changes
# https://github.com/dorny/paths-filter/releases
uses: dorny/[email protected]
id: changes
with:
filters: |
sh:
- '**.sh'
yaml:
- '**.yaml'
Dockerfile:
- '.hadolint.yaml'
- '**/Dockerfile'
hp:
- 'hp/**'
- if: steps.changes.outputs.sh == 'true'
name: Lint shell scripts
working-directory: .
run: scripts/shellscript_check.sh
- if: steps.changes.outputs.yaml == 'true'
name: Lint YAML files
working-directory: .
run: yamllint --strict .
- if: steps.changes.outputs.Dockerfile == 'true'
name: Lint httpd Dockerfile
# https://github.com/hadolint/hadolint-action/releases
uses: hadolint/[email protected]
with:
dockerfile: httpd/Dockerfile
no-color: true
- if: steps.changes.outputs.hp == 'true'
name: Setup node and install dependencies
uses: ./.github/actions/setup-node-and-install-dependencies
with:
working-directory: hp
node-version-file: hp/.nvmrc
dependencies-lock-file: hp/package-lock.json
- if: steps.changes.outputs.hp == 'true'
name: Post-install esbuild
run: node node_modules/esbuild/install.js
- if: steps.changes.outputs.hp == 'true'
name: Post-install lightningcss-cli
run: node node_modules/lightningcss-cli/postinstall.js
- if: steps.changes.outputs.hp == 'true'
name: Check formatting
run: node --run format:check
- if: steps.changes.outputs.hp == 'true'
name: Lint project files
run: node --run lint
- if: steps.changes.outputs.hp == 'true'
name: Run unit tests
run: node --run test
env:
VITEST_SKIP_INSTALL_CHECKS: 1
- if: steps.changes.outputs.hp == 'true'
name: Build project
run: node --run build
- if: steps.changes.outputs.hp == 'true'
name: Hash CSS
run: node --run hash:css
- if: steps.changes.outputs.hp == 'true'
name: Hash JS
run: node --run hash:js
- if: steps.changes.outputs.hp == 'true'
name: Minify JSON-structured script tags
run: node --run minify:json-tags
- if: steps.changes.outputs.hp == 'true'
name: Minify HTML
run: node --run minify:html
- if: steps.changes.outputs.hp == 'true'
name: Create .htaccess file
run: node --run create:htaccess
- if: steps.changes.outputs.hp == 'true'
name: Hash importmap
run: node --run hash:importmap
- if: steps.changes.outputs.hp == 'true'
name: Minify SVG
run: node --run minify:svg
- if: steps.changes.outputs.hp == 'true'
name: Hash SVG
run: node --run hash:svg
- if: steps.changes.outputs.hp == 'true'
name: Minify XML
run: node --run minify:xml
- if: steps.changes.outputs.hp == 'true'
name: Minify webmanifest
run: node --run minify:webmanifest
- if: steps.changes.outputs.hp == 'true'
name: Minify traffic-advice
run: node --run minify:traffic-advice
- if: steps.changes.outputs.hp == 'true'
name: Minify robots.txt
run: node --run minify:robots
- if: steps.changes.outputs.hp == 'true'
name: Add legal notice to robots.txt
run: node --run legal:robots
- if: steps.changes.outputs.hp == 'true'
name: Compress files
run: node --run compress:files
- if: steps.changes.outputs.hp == 'true'
name: Create Google Verification file
run: node --run create:google-verification-file
- if: steps.changes.outputs.hp == 'true'
name: Create timestamp file
run: node --run create:timestamp-file
- if: steps.changes.outputs.hp == 'true'
name: Check Links
# https://github.com/lycheeverse/lychee-action
uses: lycheeverse/[email protected]
with:
debug: true
# https://github.com/lycheeverse/lychee/releases
lycheeVersion: v0.18.0
args: --no-progress --require-https --base hp/dist