~tommoa/theme unlisted

b388ab29272c50a9e83da4635b7bdabd851e5eed — Tom Almeida 6 months ago 904eb85
actions/build(mirror): First cut at GitHub/SourceHut syncing

I can't figure out auto-submodule updating in sourcehut, so I'm going to
end up with a massively complicated system in which:

1. I push to sourcehut, which auto-pushes to GitHub, which tries to push
   back and makes no changes
2. Submodules get auto-updated on GitHub, which pushes to sourcehut,
   which pushes back to GitHub and makes no changes
2 files changed, 37 insertions(+), 0 deletions(-)

A .builds/mirror.yml
A .github/workflows/mirror.yml
A .builds/mirror.yml => .builds/mirror.yml +15 -0
@@ 0,0 1,15 @@
image: alpine/edge
sources:
  - https://git.sr.ht/~tommoa/theme
environment:
  github: git@github.com:Tommoa/theme
  branch: master
secrets:
  - a29c0ad6-f476-4c1c-bfd2-bf4c108b199f # srht-gh-deploy-key
tasks:
  - push-to-github: |
      [ "$BUILD_SUBMITTER" != "git.sr.ht" ] && exit
      echo "StrictHostKeyChecking=no" >> ~/.ssh/config
      cd theme
      git remote add github "$github"
      git push -f github "$branch"

A .github/workflows/mirror.yml => .github/workflows/mirror.yml +22 -0
@@ 0,0 1,22 @@
name: Mirror branch to sourcehut
on:
  push:
    branches:
      - master
jobs:
  mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          token: ${{ secrets.ACCESS_TOKEN }}
          submodules: recursive
      - name: Push to sourcehut
        run: |
          mkdir -p ~/.ssh
          echo "StrictHostKeyChecking=no" >> ~/.ssh/config
          echo "${{ secrets.SRHT_DEPLOY }}" > ~/.ssh/id_rsa
          chmod 600 ~/.ssh/id_rsa
          git remote add srht "git@git.sr.ht:~tommoa/theme"
          git pull --rebase srht master
          git push -f srht