From a8a215558be6d7d914e799797686f0a5c03021ca Mon Sep 17 00:00:00 2001 From: hantim <> Date: Mon, 16 Mar 2026 21:09:59 -0400 Subject: [PATCH] Initial commit --- .gitea/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ .gitignore | 1 + Dockerfile | 12 ++++++++++++ nginx.conf | 16 ++++++++++++++++ static/index.html | 7 +++++++ 5 files changed, 67 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 nginx.conf create mode 100644 static/index.html diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..62e955a --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Gitea Registry + run: echo "{ secrets.CI_REGISTRY_TOKEN }" | docker login git.timothykim.net -u timothykim --password-stdin + + - name: Build and Push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: git.timothykim.net/hantim/hantim.net:latest + + - name: Deploy + run: | + mkdir -p ~/.ssh + echo "{ secrets.DEPLOY_SSH_KEY }" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + ssh -o StrictHostKeyChecking=accept-new -i ~/.ssh/deploy_key deploy@{ vars.DEPLOY_HOST } deploy-hantim.net diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eedffd1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM nginx:alpine + +# Remove default content +RUN rm -rf /usr/share/nginx/html/* + +# static site +COPY static /usr/share/nginx/html + +# a custom nginx config +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..968505f --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + root /usr/share/nginx/html; + index index.html; + + # Clean URLs — serve index.html for directories + location / { + try_files $uri $uri/ /index.html; + } + + # Cache static assets aggressively + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..b473084 --- /dev/null +++ b/static/index.html @@ -0,0 +1,7 @@ + + +