Update Sync (#36765)

This commit is contained in:
Shiming Zhang
2024-12-20 13:51:45 +08:00
committed by GitHub
parent 89369a6deb
commit e7678e9589
5 changed files with 41 additions and 90 deletions

View File

@@ -1,4 +1,5 @@
name: Manual Deep Sync
run-name: Manual Deep Sync ${{ inputs.image }} by @${{ github.actor }}
on:
workflow_dispatch:
@@ -10,34 +11,15 @@ on:
jobs:
sync-images:
if: github.repository == 'DaoCloud/public-image-mirror'
runs-on: ubuntu-latest
if: github.repository == 'DaoCloud/public-image-mirror'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Start Proxy
env:
only_proxy: "m.daocloud.io"
- name: Set up crproxy
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
wget https://github.com/DaoCloud/crproxy/releases/download/v0.13.0-alpha.43/crproxy_linux_amd64 -O /usr/local/bin/crproxy && chmod +x /usr/local/bin/crproxy
- name: Sync Images to OSS&OBS
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: Override mirror.txt
run: |
echo ${{ github.event.inputs.image }} > mirror.txt
- 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"
SYNC: "true"
PARALLET: "1"
http_proxy: socks5://127.0.0.1:8080
https_proxy: socks5://127.0.0.1:8080
run: |
./hack/diff.sh
ORIGIN_IMAGE=${{ github.event.inputs.image }}
/usr/local/bin/crproxy sync --deep --max-warn 1 ${{ secrets.STORAGE_ARGS }} --user '${{ secrets.OCI_USER }}' --list ${ORIGIN_IMAGE}