diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 00000000..006f4af2 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,38 @@ +name: Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8.0.0 + + - name: Bootstrap + run: | + sudo apt install python3-setuptools ttfautohint build-essential libffi-dev libgit2-dev -y + make configure + make configure_preview + + - name: Build Lilex + run: make build + + - name: Build preview + run: make build_preview + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./preview/dist \ No newline at end of file diff --git a/Makefile b/Makefile index 3a1311c3..29ad7071 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ configure: requirements.txt rm -rf $(VENV_DIR) make $(VENV_DIR) +configure_preview: preview/*.yaml preview/*.json + cd preview; pnpm install + .PHONY: lint lint: $(VENV) ruff scripts/ @@ -32,6 +35,14 @@ generate: build: $(call build_font) +.PHONY: build_preview +build_preview: + cd preview; pnpm run build + +.PHONY: run_preview +run_preview: + cd preview; pnpm run dev + .PHONY: bundle bundle: rm -rf "$(BUILD_DIR)"