File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 pull_request :
77 branches : [main]
88
9+ permissions :
10+ contents : read
11+
912jobs :
1013 validate :
1114 name : Build
3235
3336 - name : Run CI Tasks (Turbo)
3437 run : pnpm turbo validate:build
38+
39+ publish :
40+ name : Publish image
41+ runs-on : ubuntu-latest
42+ needs : validate
43+ if : github.event_name == 'push'
44+ steps :
45+ - name : Checkout
46+ uses : actions/checkout@v6
47+
48+ - name : Generate image tag
49+ id : image
50+ shell : bash
51+ run : |
52+ branch="$(printf '%s' "$GITHUB_REF_NAME" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g; s/^-+//; s/-+$//; s/-+/-/g')"
53+ if [ -z "$branch" ]; then
54+ branch="unknown"
55+ fi
56+
57+ short_sha="${GITHUB_SHA::7}"
58+ timestamp="$(date +%s)"
59+
60+ tag="${branch}-${short_sha}-${timestamp}"
61+
62+ echo "tag=${tag}" >> "$GITHUB_OUTPUT"
63+
64+ - name : Login to Harbor
65+ uses : docker/login-action@v4
66+ with :
67+ registry : ${{ secrets.REGISTRY_URL }}
68+ username : ${{ secrets.REGISTRY_USERNAME }}
69+ password : ${{ secrets.REGISTRY_PASSWORD }}
70+
71+ - name : Build and push image
72+ uses : docker/build-push-action@v7
73+ with :
74+ context : .
75+ push : true
76+ tags : ${{ secrets.REGISTRY_URL }}/web/howto:${{ steps.image.outputs.tag }}
Original file line number Diff line number Diff line change @@ -17,6 +17,6 @@ RUN pnpm --filter docs build
1717FROM nginx:alpine AS runtime
1818
1919COPY --from=builder /app/apps/docs/dist /usr/share/nginx/html
20- COPY nginx.conf /etc/nginx/nginx.conf
20+ COPY deployment/ nginx.conf /etc/nginx/nginx.conf
2121
22- EXPOSE 80
22+ EXPOSE 8080
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : howto
5+ labels :
6+ app.kubernetes.io/name : howto
7+ app.kubernetes.io/part-of : howto
8+ spec :
9+ replicas : 2
10+ selector :
11+ matchLabels :
12+ app.kubernetes.io/name : howto
13+ template :
14+ metadata :
15+ labels :
16+ app.kubernetes.io/name : howto
17+ app.kubernetes.io/part-of : howto
18+ spec :
19+ imagePullSecrets :
20+ - name : harbor-regcred
21+ containers :
22+ - name : howto
23+ image : registry.timolia.systems/web/howto:main-0000000-1 # {"$imagepolicy": "web-live:howto"}
24+ imagePullPolicy : IfNotPresent
25+ ports :
26+ - name : http
27+ containerPort : 8080
28+ readinessProbe :
29+ httpGet :
30+ path : /
31+ port : http
32+ livenessProbe :
33+ httpGet :
34+ path : /
35+ port : http
Original file line number Diff line number Diff line change 1+ apiVersion : gateway.networking.k8s.io/v1
2+ kind : HTTPRoute
3+ metadata :
4+ name : howto
5+ labels :
6+ app.kubernetes.io/name : howto
7+ app.kubernetes.io/part-of : howto
8+ spec :
9+ hostnames :
10+ - howto.timolia.de
11+ parentRefs :
12+ - group : gateway.networking.k8s.io
13+ kind : Gateway
14+ name : timolia-gateway
15+ namespace : envoy-gateway-system
16+ rules :
17+ - backendRefs :
18+ - name : howto
19+ port : 80
Original file line number Diff line number Diff line change 1+ apiVersion : kustomize.config.k8s.io/v1beta1
2+ kind : Kustomization
3+ namespace : web-live
4+ resources :
5+ - deployment.yaml
6+ - service.yaml
7+ - httproute.yaml
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Service
3+ metadata :
4+ name : howto
5+ labels :
6+ app.kubernetes.io/name : howto
7+ app.kubernetes.io/part-of : howto
8+ spec :
9+ selector :
10+ app.kubernetes.io/name : howto
11+ ports :
12+ - name : http
13+ port : 80
14+ targetPort : http
Original file line number Diff line number Diff line change 1+ worker_processes auto;
2+
3+ events {
4+ worker_connections 1024 ;
5+ }
6+
7+ http {
8+ server_tokens off;
9+
10+ server {
11+ listen 8080 ;
12+ server_name _;
13+
14+ root /usr/share/nginx/html;
15+ index index .html index .htm;
16+ include /etc/nginx/mime.types ;
17+
18+ gzip on;
19+ gzip_vary on;
20+ gzip_min_length 1000 ;
21+ gzip_proxied expired no-cache no-store private auth;
22+ gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
23+
24+ location /_astro/ {
25+ expires 1y ;
26+ add_header Cache-Control "public, immutable" ;
27+ try_files $uri =404 ;
28+ }
29+
30+ error_page 404 /404 .html;
31+ location = /404 .html {
32+ root /usr/share/nginx/html;
33+ internal ;
34+ }
35+
36+ location / {
37+ try_files $uri $uri /index .html =404 ;
38+ }
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments