Merge pull request #15 from MinBZK/feature/deploy-json #1
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: Generate and Deploy Index | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Generate index.json | |
run: ./script/deploy | |
- name: Checkout deployment branch | |
run: | | |
git fetch | |
git checkout --orphan deployment | |
git reset --hard | |
git clean -fdx | |
git checkout main -- index.json | |
git add index.json | |
git commit -m 'Auto-generate index.json' | |
git push --force origin deployment | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |