Refactory

This commit is contained in:
Shiming Zhang
2021-11-18 19:13:57 +08:00
parent 6867da26c8
commit 6c1dbcdcb3
14 changed files with 300 additions and 321 deletions

View File

@@ -1,29 +1,29 @@
name: "Sync Check"
name: "Check"
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
- cron: "0 14 * * *"
jobs:
sync-check:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip3 install yq
- name: Check
env:
INCREMENTAL: "true"
QUICKLY: "true"
PARALLET: "10"
run: |
./scripts/check-image.sh
./hack/diff.sh
- name: Update badge
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Generated for update gist
BADGE_PREFIX: "gist://wzshiming/6e1f67a5184f93cefc5b2c670a5813e5"
QUICKLY: "true"
run: |
wget https://github.com/wzshiming/putingh/releases/download/v0.6.2/putingh_linux_amd64 -O /usr/local/bin/putingh && chmod +x /usr/local/bin/putingh
wget https://github.com/wzshiming/putingh/releases/download/v0.6.3/putingh_linux_amd64 -O /usr/local/bin/putingh && chmod +x /usr/local/bin/putingh
./hack/badge.sh
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-sync-badge.svg" badge.svg
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-sync.log" sync.log

View File

@@ -1,29 +1,27 @@
name: "Deep Sync Check"
name: "Deep Check"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 15 * * *"
jobs:
deep-sync-check:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip3 install yq
- name: Check
env:
INCREMENTAL: "true"
PARALLET: "20"
PARALLET: "10"
run: |
./scripts/check-image.sh
./hack/diff.sh
- name: Update badge
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Generated for update gist
BADGE_PREFIX: "gist://wzshiming/6e1f67a5184f93cefc5b2c670a5813e5"
run: |
wget https://github.com/wzshiming/putingh/releases/download/v0.6.2/putingh_linux_amd64 -O /usr/local/bin/putingh && chmod +x /usr/local/bin/putingh
wget https://github.com/wzshiming/putingh/releases/download/v0.6.3/putingh_linux_amd64 -O /usr/local/bin/putingh && chmod +x /usr/local/bin/putingh
./hack/badge.sh
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-deep-sync-badge.svg" badge.svg
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-deep-sync.log" sync.log

30
.github/workflows/deep-sync.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Deep Sync
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
jobs:
sync-images:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Start Proxy
env:
only_proxy: ".m.daocloud.io"
run: |
wget https://github.com/wzshiming/bridge/releases/download/v0.7.6/bridge_linux_amd64 -O /usr/local/bin/bridge && chmod +x /usr/local/bin/bridge
nohup /usr/local/bin/bridge -b :8080 -p - ${{ secrets.PROTOCOL }} 2>/dev/null &
- name: Sync Images
env:
INCREMENTAL: "true"
SYNC: "true"
PARALLET: "5"
http_proxy: socks5://127.0.0.1:8080
https_proxy: socks5://127.0.0.1:8080
run: |
./hack/diff.sh

31
.github/workflows/sync.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Sync
on:
schedule:
- cron: "0 * * * *"
workflow_dispatch:
jobs:
sync-images:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Start Proxy
env:
only_proxy: ".m.daocloud.io"
run: |
wget https://github.com/wzshiming/bridge/releases/download/v0.7.6/bridge_linux_amd64 -O /usr/local/bin/bridge && chmod +x /usr/local/bin/bridge
nohup /usr/local/bin/bridge -b :8080 -p - ${{ secrets.PROTOCOL }} 2>/dev/null &
- name: Sync Images
env:
INCREMENTAL: "true"
QUICKLY: "true"
SYNC: "true"
PARALLET: "5"
http_proxy: socks5://127.0.0.1:8080
https_proxy: socks5://127.0.0.1:8080
run: |
./hack/diff.sh