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 828ff13 commit cf30aea
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
name: Mirror
name: Deploy to tibrahimm.github.io

# Trigger on push to master branch
on:
push:
branches:
- master

jobs:
mirror:
deploy:
runs-on: ubuntu-latest
steps:
- name: Mirror repo
run: |
#!/bin/sh -l
# Check out source code
- name: Checkout
uses: actions/checkout@v3

# Set up Node.js
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

# Set up user info for Git.
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
# Install dependencies
- name: Install dependencies
run: yarn install

# 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
# Build project
- name: Build
run: yarn build

# 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
# Deploy to target repo
- name: Deploy
env:
# You'll need to add this secret in your repo settings
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
npx gh-pages -d dist -r https://${GITHUB_TOKEN}@github.com/t-ibrahimm/t-ibrahimm.github.io.git

0 comments on commit cf30aea

Please sign in to comment.