-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
76 lines (69 loc) · 1.78 KB
/
.gitlab-ci.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
.image-nodejs: &image-nodejs
image: node:22.13.1
.image-debian: &image-debian
image: library/debian:12.8-slim
before_script:
- apt update -qy
- apt upgrade -qy
.image-optimizt: &image-optimizt
image:
name: 343dev/optimizt:10.0.0
entrypoint: [""]
.install-angular-dependencies: &install-angular-dependencies
before_script:
- apt update -qy
- apt upgrade -qy
- apt install libnss3-dev libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libcups2 libdrm-dev libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev libgbm-dev libasound2-dev -qy
- npm install
production-build:
stage: build
<<: [*image-nodejs, *install-angular-dependencies]
script:
- npm run build
artifacts:
paths:
- dist
compress-images:
stage: build
<<: [*image-optimizt]
needs: [production-build]
script:
- find . -type f \( -iname \*.jpg -o -iname \*.jpeg -o -iname \*.png -o -iname \*.gif -o -iname \*.svg \) -exec optimizt {} +
- optimizt --avif .
- optimizt --webp .
artifacts:
paths:
- dist
only:
- main
compress-files:
stage: build
<<: [*image-debian]
needs: [compress-images]
dependencies:
- compress-images
script:
- apt install gzip brotli -qy
- cd dist
- find . -type f \( -iname "*.*" ! -iname "*.gz" ! -iname "*.br" \) -exec gzip -k --best {} \; # gzip compress all files
- find . -type f \( -iname "*.*" ! -iname "*.gz" ! -iname "*.br" \) -exec brotli -k {} \; #Brotli compress all files
artifacts:
paths:
- dist
only:
- main
pages:
stage: deploy
<<: [*image-debian]
environment:
name: production
needs: [compress-files]
dependencies:
- compress-files
script:
- mv dist/lukekuenneke.com/browser public
artifacts:
paths:
- public
only:
- main