-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Mirror | ||
on: | ||
push: | ||
branches: ["main", "dev"] | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check for SSH presence | ||
run: ssh -V | ||
- name: Add SSH key | ||
run: ssh-add - <<< ${{ secrets.MIRROR_SSH_KEY }} | ||
- name: Set up Git credentials | ||
run: | | ||
git config --global user.name "Mirror Sync Action" | ||
git config --global user.email ${{ secrets.MIRROR_EMAIL }} | ||
- name: Add mirror remote | ||
run: | | ||
if git remote get-url mirror; then | ||
echo "Mirror remote already exists" | ||
else | ||
git remote add mirror git@github.com:ImperialCollegeLondon/matlab-repo-init.git | ||
fi | ||
- run: git fetch mirror | ||
- if: false | ||
name: Push to mirror | ||
run: git push --mirror mirror |