The source code for my personal website and blog. hanna.lol
blog website

ci: configure forgejo ci for deployment

+53 -41
+53
.forgejo/workflows/deploy.yml
··· 1 + name: deploy 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + paths: 8 + - src/**/* 9 + - public/**/* 10 + - .forgejo/workflows/deploy.yml 11 + - astro.config.mjs 12 + - tsconfig.json 13 + - package.json 14 + - bun.lock 15 + 16 + jobs: 17 + build: 18 + runs-on: trixie 19 + env: 20 + TERM: dumb 21 + NIX_INSTALLER_INIT: "none" 22 + NIX_INSTALLER_NO_CONFIRM: "true" 23 + NIX_INSTALLER_ENABLE_FLAKES: "true" 24 + steps: 25 + - name: Checkout repository 26 + uses: https://code.forgejo.org/actions/checkout@v6.0.1 27 + - name: Setup lix toolchain 28 + run: curl -sL https://install.lix.systems/lix | sh -s -- install linux 29 + - name: Install bun dependencies 30 + run: nix develop -c bun install --frozen-lockfile 31 + - name: Build static files for website 32 + run: nix develop -c bun run build 33 + - name: Upload static files 34 + uses: https://code.forgejo.org/forgejo/upload-artifact@v5 35 + with: 36 + name: website-${{ forge.sha }} 37 + retention-days: 1 38 + path: dist 39 + deploy: 40 + needs: [build] 41 + runs-on: trixie 42 + env: { TERM: "dumb" } 43 + container: { image: "node:current" } 44 + steps: 45 + - name: Download static files 46 + uses: https://code.forgejo.org/forgejo/download-artifact@v7 47 + with: { name: "website-${{ forge.sha }}", path: "dist" } 48 + - name: Deploy website to cloudflare 49 + uses: https://github.com/cloudflare/wrangler-action@v3.14.1 50 + with: 51 + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} 52 + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 53 + command: pages deploy dist --project-name=website
-41
.gitlab-ci.yml
··· 1 - stages: 2 - - build 3 - - deploy 4 - 5 - workflow: 6 - rules: 7 - - changes: 8 - - src/**/* 9 - - public/**/* 10 - - astro.config.mjs 11 - - .gitlab-ci.yml 12 - - tsconfig.json 13 - - package.json 14 - - flake.lock 15 - - flake.nix 16 - - bun.lock 17 - 18 - build: 19 - stage: build 20 - image: alpine:edge 21 - variables: 22 - TERM: "dumb" 23 - NIX_INSTALLER_NO_CONFIRM: "true" 24 - NIX_INSTALLER_ENABLE_FLAKES: "true" 25 - before_script: 26 - - apk add --no-cache curl bash git xz 27 - - curl -sL https://install.lix.systems/lix | sh -s -- install linux --init none 28 - - source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh 29 - script: 30 - - nix develop -c bun install 31 - - nix develop -c bun run build 32 - artifacts: 33 - name: website-$CI_COMMIT_SHA 34 - expire_in: 1 day 35 - paths: [dist] 36 - 37 - deploy: 38 - stage: deploy 39 - image: node:alpine 40 - needs: [build] 41 - script: npx wrangler pages deploy dist --project-name=website