mirror of
https://github.com/iDvel/rime-ice.git
synced 2026-02-01 23:47:36 +00:00
feat: add GitHub Pages preview
This commit is contained in:
44
.github/workflows/pages.yml
vendored
Normal file
44
.github/workflows/pages.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: Deploy rime-ice with fcitx5-rime.js
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build rime-ice
|
||||
uses: rimeinn/deploy-schema@master
|
||||
with:
|
||||
user-recipe-list: |-
|
||||
iDvel/rime-ice:others/recipes/full
|
||||
shared-recipe-list:
|
||||
package-items: |-
|
||||
build
|
||||
lua
|
||||
opencc
|
||||
custom_phrase.txt
|
||||
|
||||
- name: Download fcitx5-rime.js
|
||||
run: |
|
||||
curl -L -o fcitx5-rime.tgz https://github.com/rimeinn/fcitx5-rime.js/releases/download/latest/fcitx5-rime.tgz
|
||||
mkdir -p fcitx5-rime
|
||||
tar -xzvf fcitx5-rime.tgz -C fcitx5-rime
|
||||
|
||||
- name: Move files to publish directory
|
||||
run: |
|
||||
mkdir -p ./public/dist
|
||||
mv /tmp/deploy-schema/artifact.zip ./public/rime-ice.zip
|
||||
mv fcitx5-rime/package/dist/* ./public/dist
|
||||
cp others/pages/index.html ./public/index.html
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./public
|
||||
12
others/pages/index.html
Normal file
12
others/pages/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<script type="module">
|
||||
import { loadZip } from "./dist/Fcitx5.js"
|
||||
await loadZip('./rime-ice.zip')
|
||||
</script>
|
||||
<h1>雾凇拼音</h1>
|
||||
<textarea></textarea>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user