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; }