nix/.forgejo/workflows/update-steamdeck.yml
2025-02-04 10:08:03 -08:00

40 lines
1.6 KiB
YAML

# yamllint disable rule:line-length rule:truthy
---
name: update-steamdeck
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
jobs:
update:
runs-on: forgejo
container:
image: git.sysctl.io/albert/actions-images/node:latest
steps:
- name: Add Gotify to Hosts
run: echo "100.64.0.5 gotify.sysctl.io" >> /etc/hosts
- name: Set up SSH Keys
run: echo "${{ secrets.SSH_PRIVATE_KEY }}" > /root/.ssh/id_ed25519
- name: Setup Node
uses: actions/setup-node@v4
- name: Update Repository
run: ssh -q -A albert@steamdeck.albert.hs.net "git -C /etc/nixos/git pull"
- run: ssh -qA -o StrictHostKeyChecking=no albert@steamdeck.albert.hs.net "nixos-version"
- name: Update NixOS
run: ssh -qA -o StrictHostKeyChecking=no albert@steamdeck.albert.hs.net "sudo nixos-rebuild switch --flake /etc/nixos/git"
- name: Update Home Manager
run: ssh -qA -o StrictHostKeyChecking=no albert@steamdeck.albert.hs.net "home-manager switch -b backup --flake /etc/nixos/git"
- run: ssh -qA -o StrictHostKeyChecking=no albert@steamdeck.albert.hs.net "nixos-version"
- name: Send Notification
uses: actions/gotify-action@master
if: always()
with:
gotify_api_base: ${{ secrets.GOTIFY_URL }}
gotify_app_token: ${{ secrets.GOTIFY_TOKEN }}
notification_title: |
${{ github.workflow }}: ${{ job.status }}
notification_message: |
Repo: ${{ github.repository }}
Status: ${{ job.status }}
Commit: ${{ github.sha }}