From cd5783769677f463bd3dee046ba99167c4c34eef Mon Sep 17 00:00:00 2001 From: Jose Henrique Date: Sat, 23 Aug 2025 20:27:49 -0300 Subject: [PATCH] templates + arm64 build (slow) --- .gitea/workflows/haven-notify.yaml | 5 +++- haven-notify/deploy/haven-notify.yaml | 2 -- .../{backup_template.tmpl => backup.tmpl} | 0 haven-notify/template/update.tmpl | 30 +++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) rename haven-notify/template/{backup_template.tmpl => backup.tmpl} (100%) create mode 100644 haven-notify/template/update.tmpl diff --git a/.gitea/workflows/haven-notify.yaml b/.gitea/workflows/haven-notify.yaml index 353bce4..b2e2fc7 100644 --- a/.gitea/workflows/haven-notify.yaml +++ b/.gitea/workflows/haven-notify.yaml @@ -31,6 +31,9 @@ jobs: -u "${{ env.REGISTRY_USERNAME }}" \ --password-stdin + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -39,7 +42,7 @@ jobs: with: push: true context: haven-notify - platforms: linux/amd64 + platforms: linux/amd64,linux/arm64 tags: | ${{ env.IMAGE_NOTIFY }}:latest diff --git a/haven-notify/deploy/haven-notify.yaml b/haven-notify/deploy/haven-notify.yaml index bfc0bc3..d4f0b13 100644 --- a/haven-notify/deploy/haven-notify.yaml +++ b/haven-notify/deploy/haven-notify.yaml @@ -38,8 +38,6 @@ spec: port: 8080 initialDelaySeconds: 5 periodSeconds: 10 - nodeSelector: - kubernetes.io/arch: amd64 --- apiVersion: v1 kind: Service diff --git a/haven-notify/template/backup_template.tmpl b/haven-notify/template/backup.tmpl similarity index 100% rename from haven-notify/template/backup_template.tmpl rename to haven-notify/template/backup.tmpl diff --git a/haven-notify/template/update.tmpl b/haven-notify/template/update.tmpl new file mode 100644 index 0000000..b82cb53 --- /dev/null +++ b/haven-notify/template/update.tmpl @@ -0,0 +1,30 @@ +{{/* +Update Notification Template +Variables expected: +- .host: The host where the update occurred +- .asset: The asset being updated (Docker or k8s) +- .time: The time in seconds that the script took to run + +Template Functions Available: +- formatTime: Formats time in seconds to a human-readable format +*/}} +{ + "embeds": [ + { + "title": "🔄 Update - {{.asset}}", + "description": "**{{.host}}** has successfully updated **{{.asset}}**! ✅", + "color": 3447003, + "fields": [ + { + "name": "⏱️ Time Taken", + "value": "{{if .time}}{{formatTime .time}}{{else}}Unknown{{end}} seconds", + "inline": true + } + ], + "footer": { + "text": "✨ Haven Notify ✨" + }, + "timestamp": "{{formatTime .timestamp}}" + } + ] +} \ No newline at end of file