Merge pull request #67 from aFlyBird0/ci-links-check
ci: links check during pr and everyday
This commit is contained in:
18
.github/workflows/cos.yaml
vendored
18
.github/workflows/cos.yaml
vendored
@@ -11,17 +11,19 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install doc dependencies
|
||||||
run: |
|
run: sudo npm i
|
||||||
sudo pip install coscmd
|
|
||||||
sudo pip install tccli
|
|
||||||
npm i
|
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
npm run docs:build
|
npm run docs:build
|
||||||
|
|
||||||
|
- name: install coscmd and tccli
|
||||||
|
run: |
|
||||||
|
sudo pip3 install coscmd
|
||||||
|
sudo pip3 install tccli
|
||||||
|
|
||||||
- name: confirgure coscmd and tccli
|
- name: confirgure coscmd and tccli
|
||||||
env:
|
env:
|
||||||
@@ -38,4 +40,4 @@ jobs:
|
|||||||
- name: upload and refresh cdn
|
- name: upload and refresh cdn
|
||||||
run: |
|
run: |
|
||||||
coscmd upload -rfs --delete ./.vitepress/dist/ /
|
coscmd upload -rfs --delete ./.vitepress/dist/ /
|
||||||
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://wiki.xyxsw.site/ --FlushType flush
|
tccli cdn PurgePathCache --cli-unfold-argument --Paths https://wiki.xyxsw.site/ --FlushType flush
|
||||||
|
|||||||
40
.github/workflows/link-pr.yaml
vendored
Normal file
40
.github/workflows/link-pr.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: links when pr
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
paths:
|
||||||
|
- '**.md'
|
||||||
|
- '.lycheeignore'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linkChecker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: install doc dependencies
|
||||||
|
run: sudo npm i
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
npm run docs:build
|
||||||
|
|
||||||
|
- name: Link Checker
|
||||||
|
uses: lycheeverse/lychee-action@v1.8.0
|
||||||
|
with:
|
||||||
|
fail: true
|
||||||
|
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
|
||||||
|
# -E, --exclude-all-private Exclude all private IPs from checking.
|
||||||
|
# -i, --insecure Proceed for server connections considered insecure (invalid TLS)
|
||||||
|
# -n, --no-progress Do not show progress bar.
|
||||||
|
# -t, --timeout <timeout> Website timeout in seconds from connect to response finished [default:20]
|
||||||
|
# --max-concurrency <max-concurrency> Maximum number of concurrent network requests [default: 128]
|
||||||
|
# -a --accept <accept> Comma-separated list of accepted status codes for valid links
|
||||||
|
|
||||||
|
# .vitepress/dist the site directory to check
|
||||||
|
# *.md all markdown files in the root directory
|
||||||
|
args: -E -i -n -t 45 --max-concurrency 64 -a 401,403 -- '.vitepress/dist' '*.md'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
45
.github/workflows/link-schedule.yaml
vendored
Normal file
45
.github/workflows/link-schedule.yaml
vendored
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: links
|
||||||
|
|
||||||
|
on:
|
||||||
|
# repository_dispatch:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 8 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
linkChecker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: install doc dependencies
|
||||||
|
run: sudo npm i
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
npm run docs:build
|
||||||
|
|
||||||
|
- name: Link Checker
|
||||||
|
uses: lycheeverse/lychee-action@v1.8.0
|
||||||
|
with:
|
||||||
|
# For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters
|
||||||
|
# -E, --exclude-all-private Exclude all private IPs from checking.
|
||||||
|
# -i, --insecure Proceed for server connections considered insecure (invalid TLS)
|
||||||
|
# -n, --no-progress Do not show progress bar.
|
||||||
|
# -t, --timeout <timeout> Website timeout in seconds from connect to response finished [default:20]
|
||||||
|
# --max-concurrency <max-concurrency> Maximum number of concurrent network requests [default: 128]
|
||||||
|
# -a --accept <accept> Comma-separated list of accepted status codes for valid links
|
||||||
|
|
||||||
|
# .vitepress/dist the site directory to check
|
||||||
|
# *.md all markdown files in the root directory
|
||||||
|
args: -E -i -n -t 45 --max-concurrency 64 -a 401,403 -- '.vitepress/dist' '*.md'
|
||||||
|
output: out.md
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
- name: Create Issue From File
|
||||||
|
uses: peter-evans/create-issue-from-file@v3
|
||||||
|
with:
|
||||||
|
title: Broken Link Detected
|
||||||
|
content-filepath: out.md
|
||||||
|
assignees: nightwhite
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
cache
|
cache
|
||||||
.temp
|
.temp
|
||||||
|
.vitepress/dist
|
||||||
|
|||||||
2
.lycheeignore
Normal file
2
.lycheeignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
hdu-cs-wiki/edit
|
||||||
|
file://
|
||||||
Reference in New Issue
Block a user