Skip to content

Commit

Permalink
Add preview automation
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Apr 2, 2023
1 parent 3572e29 commit 8a64f30
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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)"
Expand Down

0 comments on commit 8a64f30

Please sign in to comment.