|
| 1 | +# We push using git subrepo (https://github.com/ingydotnet/git-subrepo) |
| 2 | +# with some logic to recover from squashed parent commits |
| 3 | +# We first identify ourselves, needed to commit. |
| 4 | +# Then push to subrepo, commit to master. The commit is needed |
| 5 | +# to continue to replay. If we still hit issues such as this |
| 6 | +# action failing due to upstream changes, a manual resolution |
| 7 | +# PR with ./scripts/git_subrepo.sh pull will be needed. |
| 8 | +name: Mirror Repositories |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: mirror-repositories |
| 12 | +on: |
| 13 | + schedule: |
| 14 | + # Run the workflow every night at 2:00 AM UTC. |
| 15 | + cron: '0 2 * * *' |
| 16 | + |
| 17 | +jobs: |
| 18 | + mirror-to-docs-repo: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} |
| 26 | + - name: Push to docs repo |
| 27 | + run: | |
| 28 | + SUBREPO_PATH=docs |
| 29 | + git config --global user.name AztecBot |
| 30 | + git config --global user.email tech@aztecprotocol.com |
| 31 | +
|
| 32 | + if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=main; then |
| 33 | + git fetch # in case a commit came after this |
| 34 | + git rebase origin/master |
| 35 | + git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" |
| 36 | + git push |
| 37 | + fi |
| 38 | +
|
| 39 | + mirror-to-build-system-repo: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - name: Checkout |
| 43 | + uses: actions/checkout@v3 |
| 44 | + with: |
| 45 | + fetch-depth: 0 |
| 46 | + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} |
| 47 | + - name: Push to build-system repo |
| 48 | + run: | |
| 49 | + SUBREPO_PATH=build-system |
| 50 | + git config --global user.name AztecBot |
| 51 | + git config --global user.email tech@aztecprotocol.com |
| 52 | +
|
| 53 | + if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=main; then |
| 54 | + git fetch # in case a commit came after this |
| 55 | + git rebase origin/master |
| 56 | + git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" |
| 57 | + git push |
| 58 | + fi |
| 59 | +
|
| 60 | + mirror-to-barretenberg-repo: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + steps: |
| 63 | + - name: Checkout |
| 64 | + uses: actions/checkout@v3 |
| 65 | + with: |
| 66 | + fetch-depth: 0 |
| 67 | + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} |
| 68 | + - name: Push to barretenberg repo |
| 69 | + run: | |
| 70 | + SUBREPO_PATH=barretenberg |
| 71 | + git config --global user.name AztecBot |
| 72 | + git config --global user.email tech@aztecprotocol.com |
| 73 | +
|
| 74 | + if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=main; then |
| 75 | + git fetch # in case a commit came after this |
| 76 | + git rebase origin/master |
| 77 | + git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" |
| 78 | + git push |
| 79 | + fi |
0 commit comments