Skip to content

Commit

Permalink
chore: github pages deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
jxlpzqc authored Apr 10, 2024
1 parent d924c4f commit 2fdf55d
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/update-page.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,30 @@ jobs:
python-version: "3.11"
- run: pip install GitPython requests tqdm
- run: python3 ./linux-statistic.py --path ./linux
- name: Commit changes to gh-pages and push
run: |
git checkout --orphan tmp
git rm --cached -rf .
rm .gitignore
echo "edurank.hust.college" > CNAME
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add CNAME index.html result.json detail/
git commit -m "ci[bot]: update page automatically"
git push -f origin tmp:gh-pages
- run: tar caf pages.tar.gz index.html result.json detail/
- uses: actions/upload-artifact@v4
with:
name: github-pages
path: pages.tar.gz

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 comments on commit 2fdf55d

Please sign in to comment.