From 37b7b94041afab00fc3843854c4eeb03781786d5 Mon Sep 17 00:00:00 2001 From: PJ568 Date: Fri, 7 Jul 2023 09:16:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20release=20=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Spinning_Bird_Release.yml | 63 +++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/Spinning_Bird_Release.yml diff --git a/.github/workflows/Spinning_Bird_Release.yml b/.github/workflows/Spinning_Bird_Release.yml new file mode 100644 index 0000000..c1f6f14 --- /dev/null +++ b/.github/workflows/Spinning_Bird_Release.yml @@ -0,0 +1,63 @@ +name: Release + +on: + push: + branches: + - '**' + - '!min' + +jobs: + Release: + runs-on: ubuntu-latest + + steps: + - name: Clone + run: | + echo '创建 tree/:' + mkdir /home/runner/tree + echo '克隆 main 分支:' + git clone https://github.com/PJ-568/Spinning_Bird.git -b main /home/runner/tree/main + echo '检查 tree/main:' + ls /home/runner/tree/main + + - name: Checkout release branch + uses: actions/checkout@v3 + with: + ref: min + + - name: Merge + run: | + echo '清空 min:' + rm -r ./* + echo '检查 min:' + ls + echo '移动 tree/main/* 到 min/:' + cp -v -u -r /home/runner/tree/main/* . + + - name: HTML/CSS/JS Minifier + uses: docker://devatherock/minify-js:2.0.0 + with: + add_suffix: false # Optional + + - name: Generate the sitemap + id: sitemap + uses: cicirello/generate-sitemap@v1 + with: + base-url-path: https://pj568.eu.org/Spinning_Bird/ + + - 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: Push + run: | + git config --global user.name "PJ569-bot" + git config --global user.email "LiuTian-PJ568@PJ568.eu.org" + git add -A + git commit -m '自动 Release' + git push + + - name: Ping Google + run: curl https://www.google.com/ping?sitemap=https://pj568.eu.org/Spinning_Bird/sitemap.xml \ No newline at end of file