feat: deploy pages to Cloudflare pages
Some checks failed
Deploy pages / deploy (push) Failing after 20s

This commit is contained in:
Peter 2024-04-29 19:18:42 +02:00
parent dd0efaab00
commit 27e0ddf95b
Signed by: prskr
GPG key ID: F56BED6903BC5E37
14 changed files with 68 additions and 283 deletions

View file

@ -1,8 +0,0 @@
public/
.github/
.git/
Dockerfile
.dockerignore
.gitignore
.gitmodules

View file

@ -1,96 +0,0 @@
---
kind: pipeline
type: docker
name: amd64
platform:
arch: amd64
steps:
- name: image build
image: gcr.io/kaniko-project/executor:debug
network_mode: host
commands:
- >
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
- /kaniko/executor --destination "$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}_$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REPO: code.icb4dc0.de/prskr/blog
IMAGE_TAG: x86_64
BUILD_CONTEXT: .
---
kind: pipeline
type: docker
name: arm64
platform:
arch: arm64
steps:
- name: image build
image: gcr.io/kaniko-project/executor:debug
network_mode: host
commands:
- >
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
- /kaniko/executor --destination "$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}_$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REPO: code.icb4dc0.de/prskr/blog
IMAGE_TAG: arm64
BUILD_CONTEXT: .
---
kind: pipeline
type: docker
name: deploy
depends_on:
- amd64
- arm64
steps:
- name: manifest
image: quay.io/buildah/stable
network_mode: host
privileged: true
commands:
- buildah login "$${IMAGE_REGISTRY}" --username "$${GITEA_USER}" --password "$${GITEA_TOKEN}"
- buildah manifest create "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}"
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}_x86_64"
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}_arm64"
- buildah manifest push --all "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REGISTRY: code.icb4dc0.de
IMAGE_REPO: prskr/blog
- name: deploy
image: code.icb4dc0.de/prskr/ci-images/kustomize:latest
network_mode: host
commands:
- cd deploy/k8s
- kustomize edit set image buildr-docs=code.icb4dc0.de/prskr/blog:$DRONE_COMMIT_SHA
- kubectl config set-cluster hetzner --server=$K8S_API_URL --insecure-skip-tls-verify=true
- kubectl config set-credentials drone-deploy --token=$K8S_TOKEN
- kubectl config set-context hetzner --user=drone-deploy --namespace=buildr --cluster hetzner
- kubectl config use-context hetzner
- kubectl apply -k .
environment:
K8S_TOKEN:
from_secret: k8s_token
K8S_API_URL:
from_secret: k8s_api_url
when:
ref:
include:
- refs/tags/**
- refs/heads/main

View file

@ -0,0 +1,21 @@
name: Deploy pages
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
- name: Build
run: hugo --minify --environment production
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy public --project-name=blog

View file

@ -1,60 +1,57 @@
baseURL = 'https://www.icb4dc0.de/'
languageCode = 'en-us'
title = 'icb4dc0.de'
theme = ['github.com/Mitrichius/hugo-theme-anubis']
paginate = 10
enableEmoji = true
disqusShortname = ""
googleAnalytics = ""
[author]
name = "Peter Kurfer"
[module]
[[module.imports]]
path = 'github.com/LordMathis/hugo-theme-nightfall'
[params]
author = "Peter Kurfer"
style= "auto"
copyCodeButton = true
rssAsSocialIcon = true
readingTime = true
published = true
[[menu.main]]
identifier = "about"
name = "About"
url = "/about/"
[params.author]
name = "Peter Kurfer"
email = "peter.kurfer@gmail.com"
[menu]
[[menu.header]]
name = "blog"
weight = 0
url = "blog"
[[menu.header]]
name = "about"
weight = 1
[[menu.main]]
identifier = "projects"
name = "Projects"
url = "/projects/"
url = "about"
[[menu.header]]
name = "projects"
weight = 2
[[menu.main]]
identifier = "tags"
name = "Tags"
url = "/tags/"
url = "projects"
[[menu.header]]
name = "tags"
weight = 3
[[menu.main]]
identifier = "archive"
name = "Archive"
url = "/posts/"
weight = 4
url = "tags"
[[params.social]]
id = "github"
name = "baez90"
name = "github"
url = "https://github.com/prskr"
icon = "fa-brands fa-github"
target = "_blank"
aria = "GitHub Profile"
[[params.social]]
id = "linkedin"
name = "peter-s-kurfer"
name = "linkedin"
url = "https://www.linkedin.com/in/peter-s-kurfer/"
icon = "fa-brands fa-linkedin"
target = "_blank"
aria = "LinkedIn Profile"
[[params.social]]
id = "xing"
name = "xing"
url = "https://www.xing.com/profile/Sebastian_Kurfer"
[taxonomies]
category = "categories"
tag = "tags"
[markup.goldmark.renderer]
unsafe = true
icon = "fa-brands fa-xing"
target = "_blank"
aria = "Xing Profile"

View file

@ -2,6 +2,7 @@
title: 'About me'
button: 'About me'
weight: 1
showMetadata: false
---
My name's Peter. I'm a passionate software developer especially interested in all kind of networking stuff but also asynchronous data processing, software architecture, distributed computing, testing and automatic software quality analysis and many more.

View file

@ -2,6 +2,7 @@
title: 'Projects'
button: 'Projects'
weight: 2
showMetadata: false
---
## INetMock

View file

@ -1,62 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog
namespace: blog
labels:
app.kubernetes.io/name: blog
spec:
replicas: 2
selector:
matchLabels:
app.kubernetes.io/name: blog
template:
metadata:
labels:
app.kubernetes.io/name: blog
spec:
containers:
- name: blog
image: blog
ports:
- name: http
containerPort: 3000
protocol: TCP
- name: metrics
containerPort: 9100
protocol: TCP
resources:
limits:
cpu: 100m
memory: 60Mi
requests:
cpu: 50m
memory: 20Mi
livenessProbe:
httpGet:
path: /
port: http
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: http
scheme: HTTP
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
imagePullPolicy: IfNotPresent
securityContext:
capabilities:
drop:
- ALL
runAsUser: 65532
runAsNonRoot: true
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false

View file

@ -1,21 +0,0 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: blog
namespace: blog
labels:
app.kubernetes.io/name: blog
spec:
ingressClassName: traefik
rules:
- host: www.icb4dc0.de
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: blog
port:
number: 3000

View file

@ -1,19 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: blog
commonLabels:
app.kubernetes.io/instance: blog
app.kubernetes.io/managed-by: kustomize
images:
- name: blog
newName: code.icb4dc0.de/prskr/blog
newTag: latest
resources:
- "deployment.yaml"
- "service.yaml"
- "ingress.yaml"
- "pod_monitor.yaml"

View file

@ -1,14 +0,0 @@
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: blog-metrics
labels:
prometheus: default
app.kubernetes.io/name: blog
spec:
selector:
matchLabels:
app.kubernetes.io/name: blog
podMetricsEndpoints:
- port: metrics

View file

@ -1,17 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: blog
namespace: blog
labels:
app.kubernetes.io/name: blog
spec:
ports:
- name: http
protocol: TCP
port: 3000
targetPort: http
selector:
app.kubernetes.io/name: blog
type: ClusterIP

4
go.mod
View file

@ -1,5 +1,5 @@
module code.icb4dc0.de/prskr/blog
go 1.19
go 1.22.2
require github.com/Mitrichius/hugo-theme-anubis v0.0.0-20220725170731-d4ba47cd2196 // indirect
require github.com/LordMathis/hugo-theme-nightfall v0.7.1 // indirect

4
go.sum
View file

@ -1,2 +1,2 @@
github.com/Mitrichius/hugo-theme-anubis v0.0.0-20220725170731-d4ba47cd2196 h1:TzahMQaJXpezO9D2iQHnifGWPUn+41IWgYNBg/wNtQE=
github.com/Mitrichius/hugo-theme-anubis v0.0.0-20220725170731-d4ba47cd2196/go.mod h1:FKD3NbdsQzL+cXsC3x99XD/t/Rd5EyhDlNBAxQhULbo=
github.com/LordMathis/hugo-theme-nightfall v0.7.1 h1:n8T4Eg/5ZJLXGWmRHHAZ9DrbIv0yXBATeNo/A3p8EoM=
github.com/LordMathis/hugo-theme-nightfall v0.7.1/go.mod h1:0tCPxAeg5+tWhv17517Q8Lti/TPh0KNyON/uferEU30=

View file

@ -0,0 +1,2 @@
<script defer src="https://analytics.icb4dc0.de/script.js" data-website-id="fcc44d94-82fe-433a-bee1-46b586dc69f8"></script>
<script src="https://kit.fontawesome.com/e6634cbc14.js" crossorigin="anonymous"></script>