Publish Website #165
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: Publish Website | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- run: npx @kne/npm-tools download @kne-components/ued | |
env: | |
OUTPUT_PATH: ./ | |
- run: mkdir ./website | |
- run: cp -r ./build/* ./website | |
- run: echo "VERSION=$(npx @kne/npm-tools latestVersion @kne-components/ued | tail -1)" >> "$GITHUB_ENV" | |
- run: cd ./website && npx @kne/npm-tools entryHtml | |
env: | |
DEPLOY_URL: https://uc.fatalent.cn/packages/@kne-components/{{APP_NAME}}/{{VERSION}}/build | |
APP_NAME: ued | |
INDEX_HTML_PATH: ./index.html | |
# 部署static data | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'kne-union/static-data' | |
ref: 'master' | |
path: ./checkout-dir | |
- run: | | |
cd ./checkout-dir | |
rm -rf ./.github && rm -rf ./.gitignore && rm -rf ./.git | |
- run: rm -rf ./website/static-data && mkdir -p ./website/static-data && cp -r ./checkout-dir/* ./website/static-data | |
- run: rm -rf ./checkout-dir | |
- name: Deploy to GH Pages 🚀 | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./website | |
cname: www.kne-union.top | |