Skip to content

Mirror Website

Mirror Website #9

Workflow file for this run

name: Mirror Website
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout MineBuilders/.github repository (source repository)
uses: actions/checkout@v2
with:
repository: MineBuilders/.github
ref: gh-pages
token: ${{ secrets.GITHUB_TOKEN }}
path: temp-repo
- run: |
cp -r ./* ../backup/
rm -rf ../backup/.git
- name: Checkout the current repository (destination repository)
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: |
find . -mindepth 1 -not -path './.git/*' -exec rm -rf {} +
cp -r ../backup/* .
- name: Commit and push to the main branch
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add .
git commit -m "Deploy website from MineBuilders/.github repository to main"
git push origin main