-
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
828ff13
commit cf30aea
Showing
1 changed file
with
27 additions
and
17 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,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 |