diff --git a/.github/workflows/mirror-to-codeberg.yml b/.github/workflows/mirror-to-codeberg.yml new file mode 100644 index 0000000..5429708 --- /dev/null +++ b/.github/workflows/mirror-to-codeberg.yml @@ -0,0 +1,38 @@ +name: Mirror to Codeberg +on: + push: + branches: + - main + tags: + - '*' + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Push to Codeberg + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_CODEBERG }} + REPO_URL_CODEBERG: ${{ secrets.REPO_URL_CODEBERG }} + run: | + set -euxo pipefail + + mkdir -p ~/.ssh + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + cat >> ~/.ssh/config <