From 0e526907e98292dae06dd1cec929e965817d8f32 Mon Sep 17 00:00:00 2001 From: Andrew Rioux Date: Sun, 19 Oct 2025 23:45:36 -0400 Subject: [PATCH] feat: add CI/CD to automatically deploy --- .gitea/workflows/deploy.yaml | 27 +++++++++++++++++++++++++++ default.nix | 5 +---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..138f817 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,27 @@ +name: Deploy Website +on: [push] + +jobs: + build-and-deploy: + runs-on: native + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Build article code + run: | + nix-build -A articles + + - name: Deploy article HTML + run: | + cat - < ssh-key + ${{ secrets.DEPLOY_SSH_KEY }} + EOD + + nix-shell -p rsync openssh --run \ + 'rsync -avz -e "ssh -oStrictHostKeyChecking=accept-new -i ssh-key" result/* deploy@andrew.riouxs.co:/srv/site' + + - name: Remove SSH key + if: always() + run: | + shred ssh-key diff --git a/default.nix b/default.nix index d93a1ee..84787f8 100644 --- a/default.nix +++ b/default.nix @@ -19,7 +19,4 @@ let find . -name '*.org' -exec build-article {} \; ''; }; -in { - inherit build-article articles; - default = articles; -} +in { inherit build-article articles; }