[优化] #131
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: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
- '!release' | |
# paths: | |
# - '!**.md' | |
# - '!LICENSE' | |
# - '!.github\workflows\**' | |
jobs: | |
Release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone assets branch | |
run: | | |
echo '创建 tree/:' | |
mkdir /home/runner/tree | |
echo '克隆 三个分支:' | |
git clone https://github.com/PJ-568/568tools.git -b assets /home/runner/tree/assets | |
echo '检查 tree/assets:' | |
ls /home/runner/tree/assets | |
- name: Checkout main branch | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
submodules: recursive | |
- name: Merge main with assets | |
run: | | |
echo '复制 tree/assets/* 到 .:' | |
cp -v -u -r /home/runner/tree/assets/* . | |
- name: Delete 冗 | |
run: | | |
rm -r lib/tools/dwv/doc/ | |
rm -r lib/tools/webp2jpg-online/doc/ | |
# - name: HTML/CSS/JS Minifier | |
# uses: docker://devatherock/minify-js:3.0.0 | |
# with: | |
# add_suffix: false | |
- name: Generate the sitemap | |
id: sitemap | |
uses: cicirello/generate-sitemap@v1 | |
with: | |
base-url-path: https://tools.pj568.sbs/ | |
- name: Output sitemap stats | |
run: | | |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}" | |
echo "url-count = ${{ steps.sitemap.outputs.url-count }}" | |
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}" | |
- name: Deploy as pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: release # The branch the action should deploy to. | |
folder: . # The folder the action should deploy. | |
# - name: Checkout release branch | |
# uses: actions/checkout@v3 | |
# with: | |
# ref: release | |
# - name: Update tool lib | |
# run: | | |
# rm -r ./lib/ | |
# git config --global user.name "PJ569-bot" | |
# git config --global user.email "[email protected]" | |
# git submodule update | |
# # git rm --cached lib | |
# # git submodule add -b tools https://github.com/PJ-568/568tools.git ./lib | |
# # git add ./lib/ | |
# git commit -m '库更新' | |
# git push | |
- name: Ping Google | |
run: curl https://www.google.com/ping?sitemap=https://Tools.PJ568.sbs/sitemap.xml |