updated to talk about gitea actions
This commit is contained in:
BIN
public/giteaAction.png
Normal file
BIN
public/giteaAction.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
@@ -19,46 +19,89 @@ const FEATURED_PROJECTS: Project[] = [
|
|||||||
|
|
||||||
export const SIDEQUESTS: Project[] = [
|
export const SIDEQUESTS: Project[] = [
|
||||||
{
|
{
|
||||||
id: 101, // Different ID range for sidequests
|
id: 101,
|
||||||
title: "Experimental Shader",
|
title: "Working with Gitea Workers",
|
||||||
description: "A WebGL shader experiment creating procedural textures and animations. Exploring noise functions and light interactions.",
|
description: "Implementing a CI/CD pipeline using Gitea Actions to automate deployment to a Windows production server.",
|
||||||
techStack: ["WebGL", "GLSL", "React Three Fiber"],
|
techStack: ["Gitea Actions", "Docker", "PowerShell", "YAML"],
|
||||||
image: "https://placehold.co/600x400/1a1a1a/cccccc?text=Shader+Experiment", // Placeholder image
|
image: "/giteaAction.png",
|
||||||
links: {
|
links: {},
|
||||||
repo: "https://github.com/Bayda77/sidequests", // Placeholder link
|
|
||||||
},
|
|
||||||
hasDetails: true,
|
hasDetails: true,
|
||||||
sections: [
|
sections: [
|
||||||
{
|
{
|
||||||
type: 'text',
|
type: 'text',
|
||||||
title: 'Overview',
|
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',
|
type: 'code',
|
||||||
language: 'glsl',
|
language: 'yaml',
|
||||||
title: 'Noise Function',
|
title: 'Gitea Runner Config',
|
||||||
code: `float noise(vec2 st) {
|
code: `# Gitea Actions Runner
|
||||||
vec2 i = floor(st);
|
gitea-runner:
|
||||||
vec2 f = fract(st);
|
container_name: gitea-runner
|
||||||
float a = random(i);
|
image: gitea/act_runner:latest
|
||||||
float b = random(i + vec2(1.0, 0.0));
|
restart: unless-stopped
|
||||||
float c = random(i + vec2(0.0, 1.0));
|
networks:
|
||||||
float d = random(i + vec2(1.0, 1.0));
|
- web
|
||||||
vec2 u = f * f * (3.0 - 2.0 * f);
|
environment:
|
||||||
return mix(a, b, u.x) + (c - a)* u.y * (1.0 - u.x) + (d - b) * u.x * u.y;
|
- 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',
|
type: 'text',
|
||||||
title: 'Challenges',
|
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',
|
type: 'text',
|
||||||
title: 'Learnings',
|
title: 'Deployment Script Explanation',
|
||||||
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."
|
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"
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user