2022-12-22 11:09:52 +00:00
|
|
|
name: Deploy Docs to Pages
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
|
|
|
paths:
|
|
|
|
- src/**
|
|
|
|
- docs/**
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2022-12-22 11:12:47 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
2022-12-22 11:09:52 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-12-22 11:32:29 +00:00
|
|
|
|
|
|
|
- name: Copy scripts to Docs public assets
|
2022-12-22 11:09:52 +00:00
|
|
|
run: |
|
|
|
|
script_dir=docs/src/.vuepress/public/scripts
|
|
|
|
rm -rf $script_dir
|
|
|
|
mkdir $script_dir
|
2022-12-22 11:32:29 +00:00
|
|
|
cp src/* $script_dir/
|
2022-12-22 11:09:52 +00:00
|
|
|
|
2022-12-23 10:37:40 +00:00
|
|
|
- name: Install Lua
|
|
|
|
uses: ljmf00/setup-lua@v1.0.0
|
|
|
|
with:
|
|
|
|
lua-version: 5.3
|
|
|
|
install-luarocks: true
|
|
|
|
|
|
|
|
- name: Minify Scripts
|
|
|
|
run: |
|
|
|
|
script_dir=docs/src/.vuepress/public/scripts
|
|
|
|
lua minify.lua minify src/movescript.lua > $script_dir/movescript-min.lua
|
|
|
|
lua minify.lua minify src/itemscript.lua > $script_dir/itemscript-min.lua
|
2023-04-26 06:41:55 +00:00
|
|
|
lua minify.lua minify src/buildscript.lua > $script_dir/buildscript-min.lua
|
2022-12-23 10:37:40 +00:00
|
|
|
|
|
|
|
- name: Clean Up Lua Artifacts
|
|
|
|
run: |
|
|
|
|
rm -rf .lua
|
|
|
|
rm -rf .luarocks
|
|
|
|
rm -rf .source
|
|
|
|
|
2022-12-22 11:09:52 +00:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
|
|
|
|
- name: Setup Pages
|
|
|
|
uses: actions/configure-pages@v2
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
working-directory: ./docs
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Build Static HTML Site
|
|
|
|
working-directory: ./docs
|
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
- name: Upload to Pages
|
|
|
|
uses: actions/upload-pages-artifact@v1
|
|
|
|
with:
|
|
|
|
path: ./docs/src/.vuepress/dist
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v1
|
|
|
|
|