an automated quick commit and push (tpush) #15
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
# This workflow runs on push to the master branch. | |
# It checks out the code from the current repo (machine-moon/t-website), | |
# then copies everything into a fresh repo for t-ibrahimm/t-ibrahimm.github.io | |
# Finally, it commits and pushes those changes to the backup repo. | |
name: DeployMirror | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out source | |
uses: actions/checkout@v2 | |
- name: Configure Git | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
- name: Mirror to backup repo | |
run: | | |
# Make a directory for the backup repo. | |
mkdir ../backup | |
cp -R . ../backup | |
cd ../backup | |
# Initialize and push to the backup repo (force for simplicity). | |
git init | |
git remote add origin https://x-access-token:${{ secrets.MY_TOKEN }}@github.com/t-ibrahimm/t-ibrahimm.github.io.git | |
git add . | |
git commit -m "Mirror from machine-moon/t-website" | |
git push origin master --force |