Update all links #14
This file contains hidden or 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
| # Simple workflow for deploying static content to GitHub Pages | |
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build library | |
| working-directory: Build | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Build demo (copy dist and assets) | |
| run: python Demo/demo.py build | |
| - name: Copy assets for documentation | |
| run: cp -r assets Docs/ | |
| - name: Build documentation | |
| working-directory: Docs | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Prepare deployment | |
| run: | | |
| mkdir -p deploy | |
| # Copy demo with its dist and assets | |
| cp -r Demo deploy/demo | |
| # Copy documentation site | |
| cp -r Docs/site deploy/docs | |
| # Copy library dist for direct access | |
| cp -r Build/dist deploy/dist | |
| # Copy root assets | |
| cp -r assets deploy/assets | |
| # Create index redirect to docs | |
| cat > deploy/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head><meta http-equiv="refresh" content="0;url=docs/"></head> | |
| <body><a href="docs/">Go to documentation</a></body> | |
| </html> | |
| EOF | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: deploy |