Add feature to use deployments in replicate (#253) #500
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Browser Build & Web Deploy | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
# cached dependencies for node | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
docs/node_modules | |
scripts/browser-build/node_modules | |
src/lmql/ui/live/node_modules | |
src/lmql/ui/playground/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: Build website and In-Browser LMQL Distribution | |
run: cd scripts && bash deploy-web.sh | |
- uses: actions/upload-artifact@master | |
with: | |
name: lmql-web-payload | |
path: web-deploy | |
deploy-main: | |
name: Deploy Main Playground | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: | |
contains(' | |
refs/heads/main | |
', github.ref) | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/download-artifact@master | |
with: | |
name: lmql-web-payload | |
path: web-deploy | |
- name: Deploy to web branch | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: web-deploy | |
branch: web | |