CI: Housekeeping

This commit is contained in:
SukkaW
2026-02-04 10:06:46 +08:00
parent a67cb154f8
commit 5debe65a66
2 changed files with 16 additions and 16 deletions

View File

@@ -12,13 +12,13 @@ jobs:
# - name: Tune GitHub-hosted runner network # - name: Tune GitHub-hosted runner network
# # https://github.com/actions/runner-images/issues/1187 # # https://github.com/actions/runner-images/issues/1187
# uses: smorimoto/tune-github-hosted-runner-network@v1 # uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v5 - uses: actions/checkout@v6
with: with:
persist-credentials: false persist-credentials: false
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
run_install: false run_install: false
- uses: actions/setup-node@v5 - uses: actions/setup-node@v6
with: with:
node-version-file: ".node-version" node-version-file: ".node-version"
cache: "pnpm" cache: "pnpm"
@@ -33,7 +33,7 @@ jobs:
echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT
echo "second=$(date +'%S')" >> $GITHUB_OUTPUT echo "second=$(date +'%S')" >> $GITHUB_OUTPUT
- name: Restore cache.db - name: Restore cache.db
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
id: cache-db-restore id: cache-db-restore
with: with:
path: | path: |
@@ -53,7 +53,7 @@ jobs:
DEBUG: domain-alive:dead-domain,domain-alive:error:* DEBUG: domain-alive:dead-domain,domain-alive:error:*
- name: Cache cache.db - name: Cache cache.db
if: always() if: always()
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: | path: |
.cache .cache

View File

@@ -21,13 +21,13 @@ jobs:
steps: steps:
- uses: smorimoto/tune-github-hosted-runner-network@v1 - uses: smorimoto/tune-github-hosted-runner-network@v1
# https://github.com/actions/runner-images/issues/1187 # https://github.com/actions/runner-images/issues/1187
- uses: actions/checkout@v5 - uses: actions/checkout@v6
with: with:
persist-credentials: false persist-credentials: false
- uses: pnpm/action-setup@v4 - uses: pnpm/action-setup@v4
with: with:
run_install: false run_install: false
- uses: actions/setup-node@v5 - uses: actions/setup-node@v6
with: with:
node-version-file: ".node-version" node-version-file: ".node-version"
cache: "pnpm" cache: "pnpm"
@@ -36,7 +36,7 @@ jobs:
run: | run: |
echo "build_dir=previous-build-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_OUTPUT echo "build_dir=previous-build-${{ github.run_id }}-${{ github.run_number }}" >> $GITHUB_OUTPUT
- name: Download Previous Build - name: Download Previous Build
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
repository: SukkaLab/ruleset.skk.moe repository: SukkaLab/ruleset.skk.moe
persist-credentials: false persist-credentials: false
@@ -67,7 +67,7 @@ jobs:
echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT
echo "second=$(date +'%S')" >> $GITHUB_OUTPUT echo "second=$(date +'%S')" >> $GITHUB_OUTPUT
- name: Restore cache.db - name: Restore cache.db
uses: actions/cache/restore@v4 uses: actions/cache/restore@v5
id: cache-db-restore id: cache-db-restore
with: with:
path: | path: |
@@ -102,7 +102,7 @@ jobs:
exit 1 exit 1
fi fi
echo "public directory is ready: ${{ steps.ramdisk.outputs.build_dir }}" echo "public directory is ready: ${{ steps.ramdisk.outputs.build_dir }}"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v6
with: with:
name: build-artifact-${{ github.sha }}-${{ github.run_number }} name: build-artifact-${{ github.sha }}-${{ github.run_number }}
path: ${{ steps.ramdisk.outputs.build_dir }} path: ${{ steps.ramdisk.outputs.build_dir }}
@@ -112,7 +112,7 @@ jobs:
include-hidden-files: false include-hidden-files: false
- name: Cache cache.db - name: Cache cache.db
if: always() if: always()
uses: actions/cache/save@v4 uses: actions/cache/save@v5
with: with:
path: | path: |
.cache .cache
@@ -125,7 +125,7 @@ jobs:
name: Diff output name: Diff output
runs-on: ubuntu-slim runs-on: ubuntu-slim
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v7
with: with:
name: build-artifact-${{ github.sha }}-${{ github.run_number }} name: build-artifact-${{ github.sha }}-${{ github.run_number }}
path: public path: public
@@ -153,7 +153,7 @@ jobs:
id: npm_cache_path id: npm_cache_path
shell: sh shell: sh
run: echo dir=$(npm config get cache) >> $GITHUB_OUTPUT run: echo dir=$(npm config get cache) >> $GITHUB_OUTPUT
- uses: actions/cache@v4 - uses: actions/cache@v5
with: with:
path: | path: |
${{ steps.npm_cache_path.outputs.dir }} ${{ steps.npm_cache_path.outputs.dir }}
@@ -161,7 +161,7 @@ jobs:
key: deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler-${{ matrix.wranglerVersion }} key: deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler-${{ matrix.wranglerVersion }}
restore-keys: | restore-keys: |
deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler- deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler-
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v7
with: with:
name: build-artifact-${{ github.sha }}-${{ github.run_number }} name: build-artifact-${{ github.sha }}-${{ github.run_number }}
path: public path: public
@@ -179,7 +179,7 @@ jobs:
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
runs-on: ubuntu-slim runs-on: ubuntu-slim
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v7
with: with:
name: build-artifact-${{ github.sha }}-${{ github.run_number }} name: build-artifact-${{ github.sha }}-${{ github.run_number }}
path: public path: public
@@ -206,7 +206,7 @@ jobs:
- name: Upload Dist to GitHub - name: Upload Dist to GitHub
continue-on-error: true continue-on-error: true
run: | run: |
gh repo unarchive SukkaLab/ruleset.skk.moe --yes # gh repo unarchive SukkaLab/ruleset.skk.moe --yes
git clone --filter=tree:0 --no-tags https://${GH_USER}:${GH_TOKEN}@github.com/SukkaLab/ruleset.skk.moe.git ./deploy-git git clone --filter=tree:0 --no-tags https://${GH_USER}:${GH_TOKEN}@github.com/SukkaLab/ruleset.skk.moe.git ./deploy-git
cd ./deploy-git cd ./deploy-git
git config --global push.default matching git config --global push.default matching
@@ -220,7 +220,7 @@ jobs:
git push --quiet --force origin HEAD:master git push --quiet --force origin HEAD:master
cd .. cd ..
rm -rf ./deploy-git rm -rf ./deploy-git
gh repo archive SukkaLab/ruleset.skk.moe --yes # gh repo archive SukkaLab/ruleset.skk.moe --yes
env: env:
GH_EMAIL: ${{ secrets.GIT_EMAIL }} GH_EMAIL: ${{ secrets.GIT_EMAIL }}
GH_USER: ${{ secrets.GIT_USER }} GH_USER: ${{ secrets.GIT_USER }}