Sync #362
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync | |
on: | |
schedule: | |
- cron: "0 12,18 * * *" | |
workflow_dispatch: | |
jobs: | |
sync-images: | |
if: github.repository == 'DaoCloud/public-image-mirror' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Start Proxy | |
env: | |
only_proxy: "m.daocloud.io" | |
run: | | |
wget https://github.com/wzshiming/bridge/releases/download/v0.9.0/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: Check Proxy | |
run: | | |
curl -v http://127.0.0.1:8080 || exit 1 | |
curl -f --proxy 127.0.0.1:8080 -v http://m.daocloud.io/v2/ || exit 1 | |
- name: Set up skopeo | |
run: | | |
wget https://github.com/lework/skopeo-binary/releases/download/v1.13.3/skopeo-linux-amd64 -O /usr/local/bin/skopeo && chmod +x /usr/local/bin/skopeo | |
skopeo --version | |
- name: Sync Images | |
env: | |
INCREMENTAL: "true" | |
QUICKLY: "true" | |
SYNC: "true" | |
PARALLET: "2" | |
http_proxy: socks5://127.0.0.1:8080 | |
https_proxy: socks5://127.0.0.1:8080 | |
run: | | |
./hack/diff.sh |