Add icons & description #145
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 to gh-pages | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- run: npm ci | |
- run: npm test | |
- run: npm run build:cos | |
- name: Install coscmd | |
run: pip install coscmd | |
- name: Configure coscmd | |
run: coscmd config -a ${{ secrets.SecretId }} -s "${{ secrets.SecretKey }}" -b ${{ vars.BUCKET }} -r ${{ vars.REGION }} | |
- name: Publish static files to COS | |
run: | | |
cd ./build/ | |
coscmd upload -rs --delete -f ./ / --ignore index.html | |
find . -mindepth 1 ! -name index.html -exec rm -rf {} + | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |