From 03e678b8e3b643a29afcb0432dbe7ab3d4fcd78f Mon Sep 17 00:00:00 2001 From: David Timber Date: Thu, 14 Nov 2024 04:57:20 +0100 Subject: Initial commit --- .github/workflows/snapshot-automation.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/snapshot-automation.yml (limited to '.github') diff --git a/.github/workflows/snapshot-automation.yml b/.github/workflows/snapshot-automation.yml new file mode 100644 index 00000000..b6279cd2 --- /dev/null +++ b/.github/workflows/snapshot-automation.yml @@ -0,0 +1,40 @@ +name: Snapshot +run-name: Snapshot +on: + schedule: + - cron: "00 * * * *" + workflow_dispatch: +permissions: + contents: write +jobs: + Do-snapshot: + name: Do data dump snapshot + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run make + run: | + make clean + make + - name: Do commit + run: | + git config --global user.name 'Snapshot Automation Bot' + git config --global user.email '_@users.noreply.github.com' + git add --all + git commit -sm 'Data snapshot commit' + git push + - name: Install SSH secrets + env: + SSH_KEY: ${{ secrets.MIRROR_SSH_KEY }} + SSH_KNOWN_HOSTS: ${{ secrets.MIRROR_SSH_KNOWN_HOSTS }} + run: | + pushd ~ + mkdir -p .ssh .ssh_keys + echo "$SSH_KNOWN_HOSTS" >> .ssh/known_hosts + echo "$SSH_KEY" > .ssh_keys/sync-key + chmod 700 .ssh .ssh_keys + chmod 600 .ssh/known_hosts .ssh_keys/sync-key + popd + - name: Sync mirrors + run: | + ssh -T -i ~/.ssh_keys/sync-key cdci@embla.dev.snart.me -- cgit