mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-25 00:50:30 +00:00
Merge branch 'main' of https://github.com/Websoft9/websoft9 into main
This commit is contained in:
commit
c7ac405da7
1 changed files with 3 additions and 13 deletions
16
.github/workflows/dockerhub_proxy.yml
vendored
16
.github/workflows/dockerhub_proxy.yml
vendored
|
@ -12,19 +12,9 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download Markdown file and update cloudflare.js
|
- name: Download _worker.js
|
||||||
run: |
|
run: |
|
||||||
cd docker
|
curl -o _worker.js https://raw.githubusercontent.com/cmliu/CF-Workers-docker.io/main/_worker.js
|
||||||
curl -o dockerhub-proxy.md https://raw.githubusercontent.com/Websoft9/doc.websoft9.com/refs/heads/main/docs/reference/_include/dockerhub-proxy.md
|
|
||||||
|
|
||||||
# 提取 Markdown 文件中的 URL
|
|
||||||
urls=$(grep -Eo 'https://[a-zA-Z0-9./?=_-]*' dockerhub-proxy.md | sed 's/^/"/; s/$/"/' | tr '\n' ',' | sed 's/,$//')
|
|
||||||
|
|
||||||
# 创建新的 backends 数组
|
|
||||||
new_backends="const backends = [${urls}]"
|
|
||||||
|
|
||||||
# 更新 cloudflare.js 文件中的 backends 数组
|
|
||||||
sed -i "s|var backends = \[.*\]|${new_backends}|" cloudflare.js
|
|
||||||
|
|
||||||
- name: Set compatibility date
|
- name: Set compatibility date
|
||||||
id: set-date
|
id: set-date
|
||||||
|
@ -35,4 +25,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.EDIT_CLOUDFLARE_WORKERS }}
|
apiToken: ${{ secrets.EDIT_CLOUDFLARE_WORKERS }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
command: deploy docker/cloudflare.js --name dockerhub --compatibility-date ${{ env.COMPATIBILITY_DATE }}
|
command: deploy _worker.js --name dockerhub --compatibility-date ${{ env.COMPATIBILITY_DATE }}
|
||||||
|
|
Loading…
Reference in a new issue