You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
568tools/.github/workflows/568tools_Release.yml

84 lines
2.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

name: Release
on:
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:2.0.0
with:
add_suffix: false
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://tools.pj568.eu.org/
- 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 "LiuTian-PJ568@PJ568.eu.org"
# 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.eu.org/sitemap.xml