Skip to content

chore: handle events on streaming (#19) #89

chore: handle events on streaming (#19)

chore: handle events on streaming (#19) #89

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main
env:
AWS_REGION: ap-southeast-1
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('**/langdb-files/yarn.lock') }}
#----------------------------------------------
# install dependencies
#----------------------------------------------
- name: Install dependencies
run: |
poetry run pip uninstall -y langdb-kernel-lite langdb-files
poetry install --no-interaction
- name: Build the JupyterLite site
run: |
cp README.md content
sh build.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
- name: Configure AWS Credentials
if: github.ref == 'refs/heads/main'
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: deployer
aws-region: ${{ env.AWS_REGION }}
- name: Deploy jupyterlite to bucket
if: github.ref == 'refs/heads/main'
run: aws s3 sync ./dist s3://jupyterlite-dist
# - name: Invalidate pulse cloudfront
# if: github.ref == 'refs/heads/main'
# run: aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/jupyterlite/*"
deploy:
needs: build
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
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