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