更新网页压缩

main
PJ568 1 year ago
parent ca733857d5
commit 52243ec69b

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