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 32b9d1d commit cc14030
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/deploy.yml
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

0 comments on commit cc14030

Please sign in to comment.