Browse Source

feat: workflow to update the mirror github repository.

This adds a new script update-mirror that will run every day and is meant
to keep the github repository in sync with the one on crysp.
Michele Orrù 1 day ago
parent
commit
de6781d47f
2 changed files with 31 additions and 0 deletions
  1. 25 0
      .github/workflows/update-mirror.yml
  2. 6 0
      update-mirror

+ 25 - 0
.github/workflows/update-mirror.yml

@@ -0,0 +1,25 @@
+name: Update Mirror
+
+on:
+  schedule:
+    - cron: '0 0 * * *'  # Runs daily at midnight UTC
+  workflow_dispatch:  # Allows manual trigger
+
+jobs:
+  update-mirror:
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+          token: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Configure Git
+        run: |
+          git config user.name "github-actions[bot]"
+          git config user.email "github-actions[bot]@users.noreply.github.com"
+
+      - name: Run update mirror script
+        run: ./update-mirror

+ 6 - 0
update-mirror

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+set -e
+
+git pull https://git-crysp.uwaterloo.ca/SigmaProtocol/cmz main --tags
+git push origin main --tags