2024-10-03 19:19:53 +00:00
|
|
|
---
|
2024-10-02 22:57:17 +00:00
|
|
|
name: Periodic flake update
|
2024-10-03 19:19:53 +00:00
|
|
|
on: # yamllint disable-line rule:truthy
|
2024-10-02 22:57:17 +00:00
|
|
|
schedule:
|
2024-10-03 19:19:53 +00:00
|
|
|
- cron: "0 */2 * * *"
|
2024-10-02 22:57:17 +00:00
|
|
|
|
2024-10-03 19:19:53 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-10-02 22:57:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
flake-update:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: ghcr.io/catthehacker/ubuntu:runner-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-10-04 09:05:10 +00:00
|
|
|
with:
|
|
|
|
ref: master
|
2024-10-02 22:57:17 +00:00
|
|
|
- uses: cachix/install-nix-action@v27
|
|
|
|
- name: configure git
|
2024-10-08 18:41:40 +00:00
|
|
|
env:
|
|
|
|
SSH_PRIVKEY: ${{ secrets.BOT_SSH_PRIVKEY }}
|
|
|
|
SSH_PUBKEY: ${{ secrets.BOT_SSH_PUBKEY }}
|
2024-10-02 22:57:17 +00:00
|
|
|
run: |
|
2024-10-08 18:41:40 +00:00
|
|
|
echo "$SSH_PRIVKEY" > "$RUNNER_TEMP/id_ed25519"
|
|
|
|
echo "$SSH_PUBKEY" > "$RUNNER_TEMP/id_ed25519.pub"
|
|
|
|
chmod -R 0600 "$RUNNER_TEMP/id_ed25519.pub" "$RUNNER_TEMP/id_ed25519"
|
2024-10-02 22:57:17 +00:00
|
|
|
git config --global user.name 'torjus-bot'
|
|
|
|
git config --global user.email 'torjus-bot@git.t-juice.club'
|
2024-10-08 18:41:40 +00:00
|
|
|
git config --global user.signingKey "$RUNNER_TEMP/id_ed25519.pub"
|
|
|
|
git config --global gpg.format ssh
|
|
|
|
git config --global commit.gpgsign true
|
2024-10-02 22:57:17 +00:00
|
|
|
- name: flake update
|
|
|
|
run: nix flake update --commit-lock-file
|
|
|
|
- name: push
|
|
|
|
run: git push
|