updated to talk about gitea actions

This commit is contained in:
2026-01-13 00:16:03 -06:00
parent e8ec353c8f
commit fa64c4a254
2 changed files with 68 additions and 25 deletions

View File

@@ -19,46 +19,89 @@ const FEATURED_PROJECTS: Project[] = [
export const SIDEQUESTS: Project[] = [
{
id: 101, // Different ID range for sidequests
title: "Experimental Shader",
description: "A WebGL shader experiment creating procedural textures and animations. Exploring noise functions and light interactions.",
techStack: ["WebGL", "GLSL", "React Three Fiber"],
image: "https://placehold.co/600x400/1a1a1a/cccccc?text=Shader+Experiment", // Placeholder image
links: {
repo: "https://github.com/Bayda77/sidequests", // Placeholder link
},
id: 101,
title: "Working with Gitea Workers",
description: "Implementing a CI/CD pipeline using Gitea Actions to automate deployment to a Windows production server.",
techStack: ["Gitea Actions", "Docker", "PowerShell", "YAML"],
image: "/giteaAction.png",
links: {},
hasDetails: true,
sections: [
{
type: 'text',
title: 'Overview',
content: "This project started as a deep dive into the world of fragment shaders. I wanted to understand how to create organic-looking textures without relying on image assets. Using Perlin noise and fractional Brownian motion (fBm), I created a dynamic, shifting terrain that reacts to time and mouse input."
content: "Automating the deployment process using Gitea Actions. This workflow listens for pushes to the main branch, connects to a remote Windows server via SSH, updates the code, rebuilds the Docker container, and restarts the service."
},
{
type: 'code',
language: 'glsl',
title: 'Noise Function',
code: `float noise(vec2 st) {
vec2 i = floor(st);
vec2 f = fract(st);
float a = random(i);
float b = random(i + vec2(1.0, 0.0));
float c = random(i + vec2(0.0, 1.0));
float d = random(i + vec2(1.0, 1.0));
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(a, b, u.x) + (c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
}`
language: 'yaml',
title: 'Gitea Runner Config',
code: `# Gitea Actions Runner
gitea-runner:
container_name: gitea-runner
image: gitea/act_runner:latest
restart: unless-stopped
networks:
- web
environment:
- GITEA_INSTANCE_URL=http://gitea:3000
- GITEA_RUNNER_REGISTRATION_TOKEN=\${GITEA_RUNNER_TOKEN}
- GITEA_RUNNER_NAME=docker-runner
# Using catthehacker/ubuntu:act-latest which includes Docker CLI for container operations
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
- CONFIG_FILE=/config.yaml
volumes:
- ./gitea/runner:/data
- ./gitea/runner/config.yaml:/config.yaml:ro
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- gitea`
},
{
type: 'code',
language: 'yaml',
title: 'Deploy Workflow',
code: `name: Deploy to Production
on:
push:
branches: [ "main" ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy Application
uses: appleboy/ssh-action@v1.0.3
with:
host: \${{ secrets.REMOTE_HOST }}
username: \${{ secrets.REMOTE_USER }}
key: \${{ secrets.SSH_PRIVATE_KEY }}
passphrase: \${{ secrets.SSH_PASSPHRASE }}
script: |
powershell -ExecutionPolicy Bypass -Command "Write-Host '=== Starting deployment ==='; if (Test-Path 'C:\\projects\\digital-resume-FE') { Set-Location 'C:\\projects\\digital-resume-FE'; git pull origin main } else { New-Item -ItemType Directory -Path 'C:\\projects' -Force; Set-Location 'C:\\projects'; git clone https://gitea.sashabayda.ca/Bayda77/digital-resume-FE.git }; Write-Host '=== Stopping container ==='; docker stop resume-frontend; docker rm resume-frontend; Write-Host '=== Building image ==='; Set-Location 'C:\\projects\\digital-resume-FE'; docker build -t resume-frontend:latest .; Write-Host '=== Running container ==='; docker run -d --name resume-frontend --network nginx_web --restart unless-stopped -p 3001:80 resume-frontend:latest; Write-Host '=== Verifying ==='; docker ps -a --filter name=resume-frontend"`
},
{
type: 'text',
title: 'Reasoning',
content: "I wanted to automate the deployment process using Gitea Actions. Gitea is a self-hosted Git server and I wanted to take advantage of its built-in CI/CD pipeline to automate the deployment process. With it being self hosted this ment that I needed to self host my own runners. Which I used as a learning opportunity to learn more about deployment containers"
},
{
type: 'text',
title: 'Challenges',
content: "One of the biggest challenges was optimizing the GLSL code to run smoothly on lower-end devices. Mathematical operations in the fragment shader can get expensive quickly."
content: "Some of the main challenges was ensuring security to the host system and ensuring the deployment process was reliable and consistent. This includes stuff such as not exposing port 22 to the internet and keeping 'secrets' secure"
},
{
type: 'code',
language: 'powershell',
title: 'Deployment Script',
code: `powershell -ExecutionPolicy Bypass -Command "Write-Host '=== Starting deployment ==='; if (Test-Path 'C:\\projects\\digital-resume-FE') { Set-Location 'C:\\projects\\digital-resume-FE'; git pull origin main } else { New-Item -ItemType Directory -Path 'C:\\projects' -Force; Set-Location 'C:\\projects'; git clone https://gitea.sashabayda.ca/Bayda77/digital-resume-FE.git }; Write-Host '=== Stopping container ==='; docker stop resume-frontend; docker rm resume-frontend; Write-Host '=== Building image ==='; Set-Location 'C:\\projects\\digital-resume-FE'; docker build -t resume-frontend:latest .; Write-Host '=== Running container ==='; docker run -d --name resume-frontend --network nginx_web --restart unless-stopped -p 3001:80 resume-frontend:latest; Write-Host '=== Verifying ==='; docker ps -a --filter name=resume-frontend"`
},
{
type: 'text',
title: 'Learnings',
content: "I gained a much deeper understanding of the graphics pipeline, vector math, and how to think about visuals in terms of mathematical functions rather than pixels."
}
title: 'Deployment Script Explanation',
content: "The deployment script is a PowerShell script that is used to deploy the digital resume frontend to a Windows server. It first checks if the project directory exists, if it does it pulls the latest changes from the repository, if it doesn't it clones the repository. Then it stops the container, removes it, builds the image, and runs the container. Finally it verifies that the container is running and reports to gitea if it was successfull"
},
]
}
];