Skip to content

Commit

Permalink
Add build and deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
siefkenj committed Dec 12, 2024
1 parent 474a1e3 commit 3e46365
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build and deploy to github pages

on:
push:
branches: ["main"]
pull_request:
branches: ["*"]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
env:
CI: false

strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.12"

- name: Install poetry
run: python -m pip install poetry

- name: Build .whl file
run: |
python -m poetry install --all-extras
python -m poetry build
- name: Build website
run: |
cd website/
npm ci
cd ./packages/playground
npm run build
- name: Prepare for Github Pages
run: |
mkdir -p ./website
cp -r ./website/packages/playground/dist/* ./website
- name: Package website deployment
uses: actions/upload-pages-artifact@v2
with:
artifact-name: website
path: ./website

deploy:
if: ${{ github.event_name == 'push' }}
environment:
name: github-pages
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: website
uses: actions/deploy-pages@v2

0 comments on commit 3e46365

Please sign in to comment.