Deploy the Insight Website #32
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: Deploy the Insight Website | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
# permissions: | |
# contents: read | |
# pages: write | |
# id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
# Setup Python for collecting data | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
# Install the python packages | |
- run: pip install -r script/requirements.txt | |
# Collect data from Github | |
- run: python script/spider.py | |
# Process data for echarts | |
- run: python script/stats.py | |
# Setup node | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build | |
# Upload the built artifact | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: './dist' | |
- name: Deploy the website | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist # The folder the action should deploy. | |
clean-exclude: pr-preview/ |