dotfiles

My PC Dotfiles & Website
commit 369fb57eb7dda6d6ffa0453da84d3210ff7399aa
parent 777639341b3b970b3851b931d28dc88738f4085b
Author: maydayv7 <maydayv7@gmail.com>
Date:   Wed, 31 Dec 2025 18:12:55 +0530

feat(site): Deploy via Cloudflare

Diffstat:

D.github/workflows/website.yml | 33---------------------------------
Dchecks/netlify.toml | 9---------
Msite/README.md | 9+++------
Asite/package.json | 7+++++++
Asite/static/curl.txt | 8++++++++
Asite/worker.js | 16++++++++++++++++
Asite/wrangler.toml | 8++++++++
7 files changed, 42 insertions(+), 48 deletions(-)

diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml @@ -1,33 +0,0 @@ -name: "ci: Build and Deploy Site" -on: - workflow_dispatch: - push: - branches: [stable] - push: - paths: - - "site/**" -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Clone Repo - uses: actions/checkout@v6 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - name: Install Nix - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes - accept-flake-config = true - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - name: Build Zola Site - run: nix build .#website - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v4.0.0 - with: - github_token: ${{ secrets.ACCESS_TOKEN }} - publish_dir: ./result - publish_branch: deploy - cname: maydayv7.cc diff --git a/checks/netlify.toml b/checks/netlify.toml @@ -1,9 +0,0 @@ -[build] -publish = "build" -command = """ -export NP_GIT=$(which git) -curl -L https://github.com/DavHau/nix-portable/releases/latest/download/nix-portable-$(uname -m) > ./nix-portable -chmod +x nix-portable -./nix-portable nix build --impure --expr "with import <nixpkgs> {}; callPackage ./site { site = ${DEPLOY_PRIME_URL}; }" -./nix-portable nix shell nixpkgs#bash -c "bash" -c "cp -rL result build" -""" diff --git a/site/README.md b/site/README.md @@ -2,7 +2,7 @@ [![website](../files/images/website.png)](https://maydayv7.cc) -Generated using [Zola](https://www.getzola.org/), Deployed via [Nix](https://nixos.org/), [GitHub Pages](https://pages.github.com/) and [Netlify](https://netlify.com) +Generated using [Zola](https://www.getzola.org/), Deployed via [Nix](https://nixos.org/) and [Cloudflare](https://www.cloudflare.com/) Hosted at [maydayv7.cc](https://maydayv7.cc) @@ -19,11 +19,8 @@ zola -r site serve Then click [here](http://localhost:1111) -To build the site, run `nix build`. In order to override the Base URL, <code>nix-build -E "with import ../packages; callPackage ./site { site = <b><i>URL</i></b>; }"</code> can be used - -#### Continuous Integration - -[`GitHub Actions`](../checks/github/workflows/website.yml) is used in order to automatically build the site and publish it to the main domain using GitHub Pages. [Netlify](https://netlify.com) automatically deploys to [maydayv7.netlify.app](https://maydayv7.netlify.app) on every commit and allows for PR previews +To build the site, run `nix build`. +To override the URL, run <code>nix build --impure --expr "with import ../packages; callPackage ./site { site = <b><i>URL</i></b>; }"</code> ### Features diff --git a/site/package.json b/site/package.json @@ -0,0 +1,7 @@ +{ + "name": "maydayv7-site", + "version": "1.0.0", + "scripts": { + "build": "asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola latest && asdf global zola latest && zola build" + } +} diff --git a/site/static/curl.txt b/site/static/curl.txt @@ -0,0 +1,8 @@ +Bello! You found my secret 'curl' page + __ + _/o \_ +( \_ ) +/ / \ \ +\_) (_/ + +Check out my site via a browser for the full experience diff --git a/site/worker.js b/site/worker.js @@ -0,0 +1,16 @@ +export default { + async fetch(request, env) { + // Curl + const userAgent = request.headers.get("User-Agent") || ""; + if (userAgent.toLowerCase().startsWith("curl")) { + const url = new URL(request.url); + if (url.pathname === "/") { + url.pathname = "/curl.txt"; + return env.ASSETS.fetch(url); + } + } + + // Serve Website + return env.ASSETS.fetch(request); + }, +}; diff --git a/site/wrangler.toml b/site/wrangler.toml @@ -0,0 +1,8 @@ +#:schema node_modules/wrangler/config-schema.json +name = "site" +main = "worker.js" +compatibility_date = "2024-01-01" + +[assets] +directory = "./public" +binding = "ASSETS"