~timharek/deno-books

51a5b26397082034b9817ea5dd7f7573158f441c — Tim Hårek Andreassen 8 months ago 5a19804
feat: Add auto mirror to GitHub

Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
1 files changed, 26 insertions(+), 0 deletions(-)

A .build.yml
A .build.yml => .build.yml +26 -0
@@ 0,0 1,26 @@
image: alpine/edge
secrets:
  - 0323bc6f-a046-4b96-8496-2bac6e7ee107
sources:
  - git+ssh://git@git.sr.ht/~timharek/deno-books
environment:
  DIR: deno-books
triggers:
  - action: email
    condition: failure
    to: tim@harek.no
tasks:
  - check: |
      cd $DIR
      if [ "$(git rev-parse origin/main)" != "$(git rev-parse HEAD)" ]; then \
        complete-build; \
      fi
  - mirror: |
      cd $DIR
      git remote add github git@github.com:timharek/deno-books.git
      ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
      git push github main
      if [ "$(git describe --exact-match --tags HEAD)" ]; then \
        git push --tags github \
      fi