Skip to content

Commit

Permalink
Github Action to deploy demos to pages (#51)
Browse files Browse the repository at this point in the history
* add a github action to deploy apps to github pages

* add permissions

* use relative path

* change routes and add index

* fix format

* fix

* html, not md
  • Loading branch information
severo authored Nov 19, 2024
1 parent 396acce commit 7f664d5
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 37 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Deploy GitHub Pages

on:
push:
branches: ["master"]
paths:
- "packages/utils/**"
- "apps/hyparquet-demo/**"
- "apps/hightable-demo/**"
- ".github/workflows/deploy_pages.yml"
workflow_dispatch:

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm i
- name: Build @hyparam/utils package
run: npm run build
working-directory: ./packages/utils
- name: Build hyparquet demo
run: npm run build
working-directory: ./apps/hyparquet-demo
- name: Build hightable demo
run: npm run build
working-directory: ./apps/hightable-demo
- name: Create index file content
run: |
id: index_content
- name: Move the build outputs to a folder
run: |
mkdir -p build_outputs_folder/apps
echo "<h1 id="hyparam">Hyparam</h1>" > build_outputs_folder/index.html
echo "<ul>" >> build_outputs_folder/index.html
echo "<li><a href="./apps/hyparquet-demo">hyparquet demo</a></li>" >> build_outputs_folder/index.html
echo "<li><a href="./apps/hightable-demo">hightable demo</a></li>" >> build_outputs_folder/index.html
echo "</ul>" >> build_outputs_folder/index.html
echo "<h1 id="hyparam">Hyparam</h1>" > build_outputs_folder/apps/index.html
echo "<ul>" >> build_outputs_folder/apps/index.html
echo "<li><a href="./hyparquet-demo">hyparquet demo</a></li>" >> build_outputs_folder/apps/index.html
echo "<li><a href="./hightable-demo">hightable demo</a></li>" >> build_outputs_folder/apps/index.html
echo "</ul>" >> build_outputs_folder/apps/index.html
mv apps/hyparquet-demo/dist build_outputs_folder/apps/hyparquet-demo
mv apps/hightable-demo/dist build_outputs_folder/apps/hightable-demo
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: build_outputs_folder/

# Deploy job
deploy:
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading

0 comments on commit 7f664d5

Please sign in to comment.