From c482f1f5b982f7cd15af0e16e83b5a6ed90c3b51 Mon Sep 17 00:00:00 2001
From: albert <albert@sysctl.io>
Date: Sun, 2 Feb 2025 17:41:16 -0800
Subject: [PATCH] Update, add testing workflow to simply them

---
 .forgejo/workflows/deploy.yml | 40 +++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 .forgejo/workflows/deploy.yml

diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml
new file mode 100644
index 00000000..76a537f5
--- /dev/null
+++ b/.forgejo/workflows/deploy.yml
@@ -0,0 +1,40 @@
+---
+iname: Deploy Systems
+on:
+  workflow_dispatch:
+
+jobs:
+  deploy:
+    runs-on: nix
+    steps:
+      - name: Checkout repository
+        uses: https://code.forgejo.org/actions/checkout@v4
+
+      - name: Validate Flake
+        run: nix flake check
+
+      - name: Build Systems
+        run: nix build .#nixosConfigurations --show-trace
+
+      - name: Deploy with deploy-rs
+        run: nix run .#deploy -- -- --confirm
+        env:
+          DEPLOY_SSH_USER: ${{ secrets.SSH_USER }}
+          DEPLOY_SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
+
+      - if: success()
+        uses: https://git.sysctl.io/actions/gotify-action@master
+        with:
+          gotify_api_base: '${{ secrets.GOTIFY_URL }}'
+          gotify_app_token: '${{ secrets.GOTIFY_TOKEN }}'
+          notification_title: '[ ${{ github.repository }}: ${{ github.workflow }} ] NixOS Deployed'
+          notification_message: 'Deployment completed successfully.'
+        name: "Send Notification - Success"
+      - if: failure()
+        uses: https://git.sysctl.io/actions/gotify-action@master
+        with:
+          gotify_api_base: '${{ secrets.GOTIFY_URL }}'
+          gotify_app_token: '${{ secrets.GOTIFY_TOKEN }}'
+          notification_title: '[ ${{ github.repository }}: ${{ github.workflow }} ] Deployment Failed'
+          notification_message: 'Your deployment has failed.  Check Forgejo.'
+        name: "Send Notification - Failure"