-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (45 loc) · 1.51 KB
/
sync-image-dockerhub-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Sync Docker Hub Images to Aliyun and Huawei Cloud
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install skopeo
run: |
sudo apt-get update
sudo apt-get install -y skopeo
sudo apt-get install -y python3-pip
pip3 install pyyaml
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Aliyun Container Registry
uses: docker/[email protected]
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIYUM_DOCKER_USERNAME }}
password: ${{ secrets.ALIYUM_DOCKER_PASSWORD }}
- name: Login to Huawei Cloud Container Registry
uses: docker/[email protected]
with:
registry: swr.cn-southwest-2.myhuaweicloud.com
username: ${{ secrets.HWYUM_DOCKER_USERNAME }}
password: ${{ secrets.HWYUM_DOCKER_PASSWORD }}
# - name: Sync images
# run: |
# python3 sync_images.py
- name: Sync images
run: |
chmod +x sync.sh
./sync.sh "${{ secrets.HWYUM_DOCKER_USERNAME }}" "${{ secrets.HWYUM_DOCKER_PASSWORD }}" swr.cn-southwest-2.myhuaweicloud.com