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 21c757e commit 0b9198f
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: Deploy to t-ibrahimm.github.io
# 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:
- main
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: Check out source
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build
- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
- name: Mirror to backup repo
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git clone --branch gh-pages https://github.com/t-ibrahimm/t-ibrahimm.github.io.git deploy
rsync -av --delete dist/ deploy/
cd deploy
# 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 "Deploy from mainaccount:machine-moon/t-website"
git push origin gh-pages
git commit -m "Mirror from machine-moon/t-website"
git push origin master --force

0 comments on commit 0b9198f

Please sign in to comment.