Compare commits

...

70 Commits

Author SHA1 Message Date
dfcea79f84 ci: add repo secret
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/manual/build Pipeline was successful
2025-08-23 10:27:36 +03:00
06fbf2e4de ci: try to fix registry
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-23 10:04:59 +03:00
b453dd3b9e ci: update image registry
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-23 09:58:49 +03:00
46dc855a06 ci: update the trivy db
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-23 09:38:26 +03:00
623a909e43 ci: fix trivy image typo
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-16 19:51:23 +03:00
9a390bb831 ci: update trivy image
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-16 19:49:22 +03:00
0e3ae13474 ci: update workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-16 19:45:51 +03:00
dba043a4af update woodpecker workflow
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2025-08-04 21:50:04 +03:00
8a2536dd5d update workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-04 21:23:23 +03:00
1d803dbe64 update workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-04 21:18:14 +03:00
99eb2193cd ci: add push to registry step to workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/manual/build Pipeline failed
2025-08-03 21:48:00 +03:00
ea5e6f2f06 use buildx for building
Some checks failed
ci/woodpecker/manual/build Pipeline failed
2025-08-03 21:20:25 +03:00
fc3bf98fbd troubleshoot woodpecker worflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-03 21:17:29 +03:00
1c04f377bb troubleshoot woodpecker workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-03 21:12:59 +03:00
d0a576e76f troubleshoot docker push
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-03 21:09:00 +03:00
345bc2c08a update woodpecker workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-08-03 21:01:55 +03:00
9d2c2b7bcd check push in workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-29 19:37:30 +03:00
2a25da1e77 fix workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-29 19:21:36 +03:00
2209f36943 fix registry address for CI
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-29 19:13:07 +03:00
4c6bb29f9c fix woodpecker workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-29 18:59:29 +03:00
173b2778ce updated woodpecker workflow
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-28 20:36:46 +03:00
f28607e405 fix trivyignore
Some checks failed
ci/woodpecker/push/build Pipeline failed
2025-07-28 19:42:13 +03:00
dc3b4628ec deprecate gitea workflow 2025-07-28 19:31:29 +03:00
12d7e880d9 added trivyignore file
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 6m41s
ci/woodpecker/push/build Pipeline failed
Build the portfolio website / build-and-release-image (push) Successful in 4m19s
2025-07-28 19:30:51 +03:00
c427234a45 add trivyignore file
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 2m18s
ci/woodpecker/push/build Pipeline failed
Build the portfolio website / build-and-release-image (push) Has been cancelled
2025-07-28 19:21:02 +03:00
b57b11c469 update npm modules and add entry to trivyignore
Some checks failed
ci/woodpecker/push/build Pipeline failed
Build the portfolio website / build-portfolio-website (push) Successful in 15m6s
Build the portfolio website / build-and-release-image (push) Successful in 1m48s
2025-07-28 08:54:29 +03:00
e40252de99 fix npm package issue for minimatch
Some checks failed
ci/woodpecker/push/build Pipeline failed
Build the portfolio website / build-portfolio-website (push) Successful in 22m59s
Build the portfolio website / build-and-release-image (push) Failing after 30m54s
2025-07-26 20:09:19 +03:00
8c39e38fb3 update node modules 2025-07-26 20:02:36 +03:00
a298941e0c update npm packages
Some checks failed
Build the portfolio website / build-portfolio-website (push) Failing after 1m48s
Build the portfolio website / build-and-release-image (push) Has been skipped
ci/woodpecker/push/build Pipeline failed
2025-07-26 19:51:58 +03:00
a516f020ef fix woodpecker workflow
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 6m4s
ci/woodpecker/push/build Pipeline failed
Build the portfolio website / build-and-release-image (push) Failing after 5m13s
2025-07-26 19:26:05 +03:00
7f27e0c673 add woodpecker CI workflow
Some checks failed
Build the portfolio website / build-and-release-image (push) Has been cancelled
Build the portfolio website / build-portfolio-website (push) Has been cancelled
2025-07-26 19:25:24 +03:00
4879071e08 workflows: fix workflow
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 1m7s
Build the portfolio website / build-and-release-image (push) Successful in 1m21s
2025-06-29 11:16:10 +03:00
45410eaf4f Update .gitea/workflows/build.yaml
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 1m1s
Build the portfolio website / build-and-release-image (push) Successful in 2m11s
2025-06-29 08:09:14 +00:00
280511118c fix workflow 2025-06-29 11:06:42 +03:00
ae8a3643a4 frontend: fix mouse event listener 2025-06-29 11:04:31 +03:00
5c9d8de03d updated dockerfile to use slip docker image
All checks were successful
Build the portfolio website / build-and-release-image (push) Has been skipped
Build the portfolio website / build-portfolio-website (push) Successful in 1m0s
- updated dockerfile
- updated readme regarding image upload
2025-06-22 09:58:59 +03:00
f980da7daf updated the kubeconfig generator script
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-release-image (push) Successful in 1m40s
2025-05-18 10:50:25 +03:00
e7c9e6d4e0 updated README regarding CI/CD
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-release-image (push) Successful in 1m47s
2025-05-17 22:46:07 +03:00
0cdb868e6e fix docker image tag
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 48s
Build the portfolio website / build-and-release-image (push) Successful in 1m41s
2025-05-17 22:36:43 +03:00
7d29c9abbc finalize workflow to build and push container image 2025-05-17 22:34:34 +03:00
c8ca07904b remove hard coded registry
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 49s
Build the portfolio website / build-and-release-image (push) Successful in 1m42s
2025-05-17 22:32:50 +03:00
649f30075d fix
All checks were successful
Build the portfolio website / build-portfolio-website (push) Successful in 47s
Build the portfolio website / build-and-release-image (push) Successful in 1m43s
2025-05-17 22:29:22 +03:00
0052dbe30f fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 57s
Build the portfolio website / build-and-release-image (push) Failing after 37s
2025-05-17 22:23:51 +03:00
897b04fa4f fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 48s
Build the portfolio website / build-and-release-image (push) Has been cancelled
2025-05-17 22:22:11 +03:00
4f2f98988f update readme
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 53s
Build the portfolio website / build-and-release-image (push) Failing after 22s
2025-05-17 22:19:34 +03:00
9dd04356fc fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 45s
Build the portfolio website / build-and-release-image (push) Failing after 2m15s
2025-05-17 22:14:22 +03:00
9654ea3050 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 46s
Build the portfolio website / build-and-release-image (push) Failing after 11s
2025-05-17 22:11:26 +03:00
82c8b1d451 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 53s
Build the portfolio website / build-and-release-image (push) Has been cancelled
2025-05-17 22:10:26 +03:00
b5877f36f5 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 51s
Build the portfolio website / build-and-release-image (push) Failing after 11s
2025-05-17 22:04:52 +03:00
cbca63c43f fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 46s
Build the portfolio website / build-and-release-image (push) Failing after 0s
2025-05-17 21:53:15 +03:00
9f95564022 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 45s
Build the portfolio website / build-and-release-image (push) Failing after 0s
2025-05-17 21:47:18 +03:00
c451ec5b92 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 46s
Build the portfolio website / build-and-release-image (push) Failing after 4s
2025-05-17 21:42:38 +03:00
4c0ad887b5 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-release-image (push) Failing after 4s
2025-05-17 21:34:16 +03:00
c7746ff91d fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 52s
Build the portfolio website / build-and-release-image (push) Failing after 23s
2025-05-17 21:28:42 +03:00
aad5dc83e1 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 55s
Build the portfolio website / build-and-release-image (push) Failing after 18s
2025-05-17 21:16:56 +03:00
c9898eb26c fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-release-image (push) Failing after 16s
2025-05-17 21:13:59 +03:00
2a5702db4b fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 46s
Build the portfolio website / build-and-release-image (push) Failing after 21s
2025-05-17 21:12:17 +03:00
2badabb167 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 45s
Build the portfolio website / build-and-release-image (push) Has been cancelled
2025-05-17 21:11:18 +03:00
3f5facc265 fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 53s
Build the portfolio website / build-and-release-image (push) Failing after 14s
2025-05-17 21:08:24 +03:00
9d15e4e50e fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 45s
Build the portfolio website / build-and-release-image (push) Failing after 17s
2025-05-17 21:02:45 +03:00
b45468fcbd continueing with troubleshooting
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-release-image (push) Failing after 0s
2025-05-17 20:56:31 +03:00
e5534d4f1d continueing with the fix
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 56s
Build the portfolio website / build-and-release-image (push) Failing after 1m2s
2025-05-17 20:54:11 +03:00
a3580be305 fix gitea runner
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 47s
Build the portfolio website / build-and-release-image (push) Failing after 2m16s
2025-05-17 20:46:37 +03:00
47660ff80c update the build and push workflow
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 46s
Build the portfolio website / build-and-push-docker-image (push) Failing after 1m34s
2025-05-17 15:35:21 +03:00
940435cc8a fix workflow following gitea workflow in github
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 47s
Build the portfolio website / build-and-push-docker-image (push) Has been cancelled
2025-05-17 15:26:24 +03:00
6d76e17613 third attempt to fix workflow
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 1m32s
Build the portfolio website / build-and-push-docker-image (push) Has been cancelled
2025-05-17 15:23:54 +03:00
1d37e5a39f second attempt to fix the docker build workflow
Some checks failed
Build the portfolio website / build-portfolio-website (push) Failing after 1m16s
2025-05-17 15:19:54 +03:00
9cdb13c753 fix workflow for docker build
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 53s
Build the portfolio website / build-and-push-docker-image (push) Failing after 1m25s
2025-05-17 15:15:09 +03:00
97d9372642 add workflow actions for building the app
Some checks failed
Build the portfolio website / build-portfolio-website (push) Successful in 54s
Build the portfolio website / build-and-push-docker-image (push) Failing after 20s
2025-05-17 15:11:18 +03:00
44d312ab4e added script to create kubeconfig for CI/CD
Some checks failed
Build the portfolio website / build-and-push-docker-image (push) Failing after 2m26s
Build the portfolio website / build-portfolio-website (push) Failing after 2m31s
2025-05-17 15:04:34 +03:00
11 changed files with 4261 additions and 2964 deletions

View File

@ -0,0 +1,73 @@
name: Build the portfolio website
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-portfolio-website:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Install dependencies
run: cd frontend && npm install
- name: Build the project
run: cd frontend && npm run build
build-and-release-image:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
needs: build-portfolio-website
if: success()
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # all history for all branches and tags
- name: Create kubeconfig
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config
chmod 600 ~/.kube/config
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: kubernetes
driver-opts: |
namespace=gitea
qemu.install=true
- name: Login to Docker registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Generate timestamp
id: timestamp
run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITEA_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: |
${{ secrets.DOCKER_REGISTRY }}/taqi/portfolio/my-portfolio-app:latest
${{ secrets.DOCKER_REGISTRY }}/taqi/portfolio/my-portfolio-app:1.0.0-${{ steps.timestamp.outputs.timestamp }}

9
.trivyignore Normal file
View File

@ -0,0 +1,9 @@
CVE-2024-4068
CVE-2024-21538
CVE-2024-21536
CVE-2025-7783
CVE-2024-29415
CVE-2022-23539
CVE-2022-24771
CVE-2022-24772
CVE-2024-29180

35
.woodpecker/build.yaml Normal file
View File

@ -0,0 +1,35 @@
when:
- event: [push, pull_request, manual]
branch: [master, feature/*]
steps:
- name: trivy-scan
image: aquasec/trivy:latest
commands:
- trivy fs --scanners vuln,config --exit-code 1 --ignorefile .trivyignore --severity HIGH,CRITICAL frontend/
- name: lint-frontend
image: node:24
commands:
- cd frontend
- npm install
- npm run lint
- name: build-and-publish
image: woodpeckerci/plugin-docker-buildx
settings:
registry:
from_secret: docker_registry
repo:
from_secret: portfolio_docker_repo
tags:
- latest
- 1.0.0-${CI_PIPELINE_NUMBER} # Ref: https://woodpecker-ci.org/docs/usage/environment
skip_tls_verify: false # set to true for testing registries ONLY with self-signed certs
build_args:
- COMMIT_SHA=${CI_COMMIT_SHA}
- COMMIT_AUTHOR_EMAIL=${CI_COMMIT_AUTHOR_EMAIL}
username:
from_secret: docker-username
password:
from_secret: docker-password

View File

@ -1,5 +1,5 @@
# Step 1: Build the React app
FROM node:20 AS build
FROM node:24-slim AS build
WORKDIR /app

View File

@ -1,5 +1,4 @@
My Portfolio Website
=====================
# My Portfolio Website
# Overview
@ -31,4 +30,19 @@ docker push $DOCKER_REGISTRY/my-portfolio-app:latest
# Check the registry
curl -u user:pass https://$DOCKER_REGISTRY/v2/_catalog
```
# Or if using gitea registry
curl --netrc -X GET https://gitea.yourdomain.com/v2/_catalog
```
# CI/CD
Run in Gitea Actions within kubernetes cluster
Current, the project has workflow files for:
- Build and push the container to the registry
- Deploy the container to the Kubernetes cluster
Thus making a commit to the master branch will automatically build the
container and deploy it to the cluster.

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,9 @@
"tailwindcss": "^3.4.11",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.1"
"vite": "^7.0.6"
},
"overrides": {
"@types/minimatch": "5.1.2"
}
}

View File

@ -35,11 +35,13 @@ const Navbar: React.FC<NavProps> = ({ toggleDarkMode, darkMode }) => {
}
}
document.addEventListener('mousedown', handleClickoutside)
if (isMenuOpen) {
document.addEventListener('mousedown', handleClickoutside)
}
return () => {
document.removeEventListener('mousedown', handleClickoutside)
}
})
}, [isMenuOpen])
const menuItem = [
{ title: 'Home', href: '/' },

View File

@ -1 +1 @@
{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/Introduction.tsx","./src/components/Navbar.tsx","./src/components/Photo.tsx","./src/components/Skills.tsx"],"version":"5.6.2"}
{"root":["./src/App.tsx","./src/constants.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/Footer.tsx","./src/components/Introduction.tsx","./src/components/Navbar.tsx","./src/components/Photo.tsx","./src/components/Sidebar.tsx","./src/components/Skills.tsx","./src/components/Tooltip.tsx","./src/pages/Experience.tsx","./src/pages/Home.tsx","./src/pages/Interests.tsx","./src/pages/Projects.tsx"],"version":"5.8.3"}

View File

@ -1 +1 @@
{"root":["./vite.config.ts"],"version":"5.6.2"}
{"root":["./vite.config.ts"],"version":"5.8.3"}

144
scripts/create_kubeconfig.sh Executable file
View File

@ -0,0 +1,144 @@
#!/usr/bin/env bash
function usage() {
echo "--namespace <namespace> --user <user> --kubeconfig <kubeconfig>"
}
function create_namespace() {
local namespace="$1"
kubectl create namespace "$namespace" \
--dry-run=client -o yaml | kubectl apply -f -
}
function create_service_account() {
local user="$1"
local namespace="$2"
kubectl create serviceaccount "$user" \
--namespace "$namespace" \
--dry-run=client -o yaml | kubectl apply -f -
# Create associated secret
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: ${user}-secret
namespace: ${namespace}
annotations:
kubernetes.io/service-account.name: ${user}
type: kubernetes.io/service-account-token
EOF
echo "Service account $user created in namespace $namespace"
}
function create_role() {
local user="$1"
local namespace="$2"
kubectl create role "$user" \
--verb=get,list,watch,create,update,delete,patch,exec \
--resource=pods,pods/exec,services,deployments,secrets,configmaps \
--namespace "$namespace" \
--dry-run=client -o yaml | kubectl apply -f -
echo "Role $user created in namespace $namespace"
}
function create_role_binding() {
local user="$1"
local namespace="$2"
kubectl create rolebinding "$user" \
--role="$user" \
--serviceaccount="$namespace:$user" \
--namespace "$namespace" \
--dry-run=client -o yaml | kubectl apply -f -
echo "Role binding $user created in namespace $namespace"
}
function create_kubeconfig() {
local user="$1"
local namespace="$2"
local kubeconfig="$3"
SECRET_NAME=${user}-secret
CLUSTER_NAME=$(kubectl config view --minify -o jsonpath='{.clusters[0].name}')
TOKEN=$(kubectl get secret "$SECRET_NAME" -n "$namespace" -o jsonpath='{.data.token}' | base64 --decode)
CA=$(kubectl get secret "$SECRET_NAME" -n "$namespace" -o jsonpath='{.data.ca\.crt}')
SERVER=$(kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}')
# Create kubeconfig file with proper indentation
cat >"${kubeconfig}" <<EOF
apiVersion: v1
kind: Config
clusters:
- name: ${CLUSTER_NAME}
cluster:
server: ${SERVER}
certificate-authority-data: ${CA}
contexts:
- name: ${CLUSTER_NAME}-${namespace}-ci
context:
cluster: ${CLUSTER_NAME}
namespace: ${namespace}
user: ${user}
current-context: ${CLUSTER_NAME}-${namespace}-ci
users:
- name: ${user}
user:
token: ${TOKEN}
EOF
echo "Kubeconfig file created at ${kubeconfig}"
}
# Main script
function main() {
local namespace=""
local user=""
local kubeconfig=""
while [[ "$#" -gt 0 ]]; do
case $1 in
-n|--namespace)
namespace="$2"
shift
;;
-u|--user)
user="$2"
shift
;;
-k|--kubeconfig)
kubeconfig="$2"
shift
;;
-h|--help)
usage
exit 0
;;
*)
usage
exit 1
;;
esac
shift
done
if [[ -z "$namespace" || -z "$user" || -z "$kubeconfig" ]]; then
usage
exit 1
fi
create_namespace "$namespace"
create_service_account "$user" "$namespace"
create_role "$user" "$namespace"
create_role_binding "$user" "$namespace"
create_kubeconfig "$user" "$namespace" "$kubeconfig"
}
# Call the main function
main "$@"