an automated quick commit and push (tpush) #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mirror | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Mirror repo | |
run: | | |
#!/bin/sh -l | |
# Set up user info for Git. | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
# Clone machine-moon/t-website using a token that has read permissions. | |
# Replace MY_READ_TOKEN with the secret that has read access to machine-moon/t-website. | |
git clone --bare "https://${{ secrets.MY_READ_TOKEN }}@github.com/machine-moon/t-website.git" repo | |
cd repo | |
# Add another remote that has write permissions for t-ibrahimm/t-ibrahimm.github.io | |
# Replace MY_WRITE_TOKEN with the secret that has push permissions to t-ibrahimm/t-ibrahimm.github.io | |
git remote add --mirror=fetch mirror "https://${{ secrets.MY_WRITE_TOKEN }}@github.com/t-ibrahimm/t-ibrahimm.github.io.git" | |
git fetch --all | |
git push mirror --all --force |