mirror of
https://github.com/polarity-lang/polarity.git
synced 2025-12-23 09:19:50 +00:00
48 lines
1.4 KiB
YAML
48 lines
1.4 KiB
YAML
name: Build and deploy web demo
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# We run this action also on PRs but skip the deployment part
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Web build
|
|
run: |
|
|
cd web/
|
|
make deps
|
|
make build
|
|
- name: Create zip package
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
cd web/packages/web-editor/dist && zip -r ../../../../web-demo-latest.zip ./*
|
|
- name: Create release
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: latest
|
|
draft: false
|
|
prerelease: false
|
|
files: web-demo-latest.zip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Trigger website build
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
curl -X POST \
|
|
-H "Accept: application/vnd.github.v3+json" \
|
|
-H "Authorization: token ${{ secrets.WEB_TRIGGER_DEPLOY_TOKEN }}" \
|
|
https://api.github.com/repos/polarity-lang/polarity-lang.github.io/dispatches \
|
|
-d '{"event_type":"trigger-deploy"}'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|