Skip to content

chore(ci): add dormant push-email notification workflow (#39) #103

chore(ci): add dormant push-email notification workflow (#39)

chore(ci): add dormant push-email notification workflow (#39) #103

Workflow file for this run

# // Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
# SPDX-License-Identifier: MPL-2.0
name: Mirror to Git Forges
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
mirror-gitlab:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.GITLAB_MIRROR_ENABLED == 'true'
env:
GITLAB_SSH_KEY: ${{ secrets.GITLAB_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.GITLAB_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.GITLAB_SSH_KEY }}
- name: Mirror to GitLab
run: |
ssh-keyscan -t ed25519 gitlab.com >> ~/.ssh/known_hosts
git remote add gitlab git@gitlab.com:hyperpolymath/${{ github.event.repository.name }}.git || true
git push --force gitlab main
mirror-bitbucket:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.BITBUCKET_MIRROR_ENABLED == 'true'
env:
BITBUCKET_SSH_KEY: ${{ secrets.BITBUCKET_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.BITBUCKET_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.BITBUCKET_SSH_KEY }}
- name: Mirror to Bitbucket
run: |
ssh-keyscan -t ed25519 bitbucket.org >> ~/.ssh/known_hosts
git remote add bitbucket git@bitbucket.org:hyperpolymath/${{ github.event.repository.name }}.git || true
git push --force bitbucket main
mirror-codeberg:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.CODEBERG_MIRROR_ENABLED == 'true'
env:
CODEBERG_SSH_KEY: ${{ secrets.CODEBERG_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.CODEBERG_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.CODEBERG_SSH_KEY }}
- name: Mirror to Codeberg
run: |
ssh-keyscan -t ed25519 codeberg.org >> ~/.ssh/known_hosts
git remote add codeberg git@codeberg.org:hyperpolymath/${{ github.event.repository.name }}.git || true
git push --force codeberg main
mirror-sourcehut:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.SOURCEHUT_MIRROR_ENABLED == 'true'
env:
SOURCEHUT_SSH_KEY: ${{ secrets.SOURCEHUT_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.SOURCEHUT_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.SOURCEHUT_SSH_KEY }}
- name: Mirror to SourceHut
run: |
ssh-keyscan -t ed25519 git.sr.ht >> ~/.ssh/known_hosts
git remote add sourcehut git@git.sr.ht:~hyperpolymath/${{ github.event.repository.name }} || true
git push --force sourcehut main
mirror-disroot:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.DISROOT_MIRROR_ENABLED == 'true'
env:
DISROOT_SSH_KEY: ${{ secrets.DISROOT_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.DISROOT_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.DISROOT_SSH_KEY }}
- name: Mirror to Disroot
run: |
ssh-keyscan -t ed25519 git.disroot.org >> ~/.ssh/known_hosts
git remote add disroot git@git.disroot.org:hyperpolymath/${{ github.event.repository.name }}.git || true
git push --force disroot main
mirror-gitea:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.GITEA_MIRROR_ENABLED == 'true'
env:
GITEA_SSH_KEY: ${{ secrets.GITEA_SSH_KEY }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- if: ${{ env.GITEA_SSH_KEY != '' }}
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ env.GITEA_SSH_KEY }}
- name: Mirror to Gitea
run: |
ssh-keyscan -t ed25519 ${{ vars.GITEA_HOST }} >> ~/.ssh/known_hosts
git remote add gitea git@${{ vars.GITEA_HOST }}:hyperpolymath/${{ github.event.repository.name }}.git || true
git push --force gitea main
mirror-radicle:
runs-on: ubuntu-latest
timeout-minutes: 15
if: vars.RADICLE_MIRROR_ENABLED == 'true'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
with:
fetch-depth: 0
- name: Setup Rust
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable
with:
toolchain: stable
- name: Install Radicle
run: |
# Install via cargo (safer than curl|sh)
cargo install radicle-cli --locked
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Mirror to Radicle
env:
RADICLE_KEY: ${{ secrets.RADICLE_KEY }}
if: ${{ env.RADICLE_KEY != '' }}
run: |
echo "$RADICLE_KEY" > ~/.radicle/keys/radicle
chmod 600 ~/.radicle/keys/radicle
rad sync --announce || echo "Radicle sync attempted"