Skip to content

Commit

Permalink
an automated quick commit and push (tpush)
Browse files Browse the repository at this point in the history
  • Loading branch information
machine-moon committed Jan 3, 2025
1 parent cc14030 commit 828ff13
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Mirror script
- name: Mirror repo
run: |
#!/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
# 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

0 comments on commit 828ff13

Please sign in to comment.