|
| 1 | +name: Deploy GitHub Pages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["master"] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + # Build job |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout the repository |
| 14 | + uses: actions/checkout@v4 |
| 15 | + - name: Build components package and demo apps |
| 16 | + run: | |
| 17 | + npm i |
| 18 | + npm run build -w @hyparam/components |
| 19 | + npm run build -w hyparquet |
| 20 | + npm run build -w hightable |
| 21 | + - name: Move the build outputs to a folder |
| 22 | + run: | |
| 23 | + mkdir -p build_outputs_folder |
| 24 | + echo "<h1 id="hyparam">Hyperparam</h1>" > build_outputs_folder/index.html |
| 25 | + echo "<ul>" >> build_outputs_folder/index.html |
| 26 | + echo "<li><a href="./hyparquet">hyparquet demo</a></li>" >> build_outputs_folder/index.html |
| 27 | + echo "<li><a href="./hightable">hightable demo</a></li>" >> build_outputs_folder/index.html |
| 28 | + echo "</ul>" >> build_outputs_folder/index.html |
| 29 | + echo "<h1 id="hyparam">Hyperparam</h1>" > build_outputs_folder/index.html |
| 30 | + echo "<ul>" >> build_outputs_folder/index.html |
| 31 | + echo "<li><a href="./hyparquet">hyparquet demo</a></li>" >> build_outputs_folder/index.html |
| 32 | + echo "<li><a href="./hightable">hightable demo</a></li>" >> build_outputs_folder/index.html |
| 33 | + echo "</ul>" >> build_outputs_folder/index.html |
| 34 | + mv hyparquet/dist build_outputs_folder/hyparquet |
| 35 | + mv hightable/dist build_outputs_folder/hightable |
| 36 | + - name: Upload static files as artifact |
| 37 | + id: deployment |
| 38 | + uses: actions/upload-pages-artifact@v3 |
| 39 | + with: |
| 40 | + path: build_outputs_folder/ |
| 41 | + |
| 42 | + # Deploy job |
| 43 | + deploy: |
| 44 | + needs: build |
| 45 | + permissions: |
| 46 | + pages: write # to deploy to Pages |
| 47 | + id-token: write # to verify the deployment originates from an appropriate source |
| 48 | + environment: |
| 49 | + name: github-pages |
| 50 | + url: ${{ steps.deployment.outputs.page_url }} |
| 51 | + runs-on: ubuntu-latest |
| 52 | + steps: |
| 53 | + - name: Deploy to GitHub Pages |
| 54 | + id: deployment |
| 55 | + uses: actions/deploy-pages@v4 |
0 commit comments