-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
an automated quick commit and push (tpush)
- Loading branch information
1 parent
32b9d1d
commit cc14030
Showing
1 changed file
with
9 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,19 @@ | ||
# 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 | ||
name: Mirror | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy: | ||
mirror: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure Git | ||
- name: Mirror script | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
- name: Mirror to backup repo | ||
run: | | ||
# Remove the backup directory if it exists, then recreate it. | ||
rm -rf ../backup | ||
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 | ||
#!/bin/sh -l | ||
REMOTE="https://${{ secrets.MY_TOKEN }}@github.com/t-ibrahimm/t-ibrahimm.github.io.git" | ||
git clone --bare "https://${GITHUB_ACTOR}:${{ secrets.MY_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" . | ||
git remote add --mirror=fetch mirror "$REMOTE" | ||
git fetch mirror +refs/heads/*:refs/remotes/origin/* | ||
git push --force --mirror --prune origin |