9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
||||
.git
|
||||
.gitea
|
||||
.claude
|
||||
.DS_Store
|
||||
docs/
|
||||
assets/
|
||||
landing.html
|
||||
*.md
|
||||
k3s/
|
||||
62
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,62 @@
|
||||
name: Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
REGISTRY: git.arthurbarre.fr
|
||||
IMAGE: ordinarthur/rubis
|
||||
NAMESPACE: rubis
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ordinarthur
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
|
||||
|
||||
- name: Install kubectl
|
||||
run: |
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl
|
||||
mv kubectl /usr/local/bin/
|
||||
|
||||
- name: Deploy to K3s
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
|
||||
chmod 600 ~/.kube/config
|
||||
|
||||
kubectl apply -f k3s/namespace.yml
|
||||
|
||||
kubectl -n $NAMESPACE create secret docker-registry gitea-registry \
|
||||
--docker-server=$REGISTRY \
|
||||
--docker-username=ordinarthur \
|
||||
--docker-password=${{ secrets.REGISTRY_PASSWORD }} \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
kubectl apply -f k3s/deployment.yml
|
||||
kubectl apply -f k3s/service.yml
|
||||
|
||||
kubectl -n $NAMESPACE set image deployment/rubis \
|
||||
rubis=$REGISTRY/$IMAGE:${{ github.sha }}
|
||||
|
||||
kubectl -n $NAMESPACE rollout status deployment/rubis --timeout=120s
|
||||
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
.env
|
||||
.env.local
|
||||
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY public/ /usr/share/nginx/html/
|
||||
|
||||
RUN printf 'server {\n\
|
||||
listen 80;\n\
|
||||
server_name _;\n\
|
||||
root /usr/share/nginx/html;\n\
|
||||
index index.html;\n\
|
||||
\n\
|
||||
location / {\n\
|
||||
try_files $uri $uri/ /index.html;\n\
|
||||
}\n\
|
||||
\n\
|
||||
location ~* \\.(?:css|js|svg|png|jpg|jpeg|gif|ico|webp|woff2?)$ {\n\
|
||||
expires 7d;\n\
|
||||
add_header Cache-Control "public, max-age=604800, immutable";\n\
|
||||
}\n\
|
||||
\n\
|
||||
location = /site.webmanifest {\n\
|
||||
add_header Content-Type application/manifest+json;\n\
|
||||
}\n\
|
||||
}\n' > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
BIN
assets/logo.png
Normal file
|
After Width: | Height: | Size: 846 KiB |
45
k3s/deployment.yml
Normal file
@ -0,0 +1,45 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: rubis
|
||||
namespace: rubis
|
||||
labels:
|
||||
app: rubis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: rubis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: rubis
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: gitea-registry
|
||||
containers:
|
||||
- name: rubis
|
||||
image: git.arthurbarre.fr/ordinarthur/rubis:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
memory: "32Mi"
|
||||
cpu: "10m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "200m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
4
k3s/namespace.yml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: rubis
|
||||
14
k3s/service.yml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: rubis
|
||||
namespace: rubis
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: rubis
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
nodePort: 30109
|
||||
BIN
public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
public/favicon-96x96.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
3
public/favicon.svg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
@ -16,6 +16,13 @@
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet">
|
||||
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96" />
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
||||
<link rel="shortcut icon" href="favicon.ico" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
|
||||
<meta name="apple-mobile-web-app-title" content="Rubis" />
|
||||
<link rel="manifest" href="site.webmanifest" />
|
||||
<meta name="theme-color" content="#9F1239" />
|
||||
<style>
|
||||
:root {
|
||||
--rubis: #9F1239;
|
||||
21
public/site.webmanifest
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "Rubis Sur l'Ongle",
|
||||
"short_name": "Rubis",
|
||||
"icons": [
|
||||
{
|
||||
"src": "web-app-manifest-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "web-app-manifest-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"theme_color": "#9F1239",
|
||||
"background_color": "#FAF7F2",
|
||||
"display": "standalone"
|
||||
}
|
||||
BIN
public/web-app-manifest-192x192.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
public/web-app-manifest-512x512.png
Normal file
|
After Width: | Height: | Size: 309 KiB |