ci: auto trigger mirror #2
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
name: Publish website on GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/gh-pages.yml' | |
- 'website/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Build website | |
run: | | |
cd website | |
npm i | |
npm run pack | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./website/build | |
- name: Trigger mirror | |
run: | | |
sleep 120 | |
curl -X POST \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-d '{"event_type": "trigger-mirror"}' \ | |
https://api.github.com/repos/MineBuilders/minebuilders.github.io/dispatches |