Skip to content

Commit a425601

Browse files
authored
增加平台参数
1 parent 7c10f90 commit a425601

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/mirror.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ on:
2323
description: '空间名称'
2424
required: true
2525
default: 'dockerhub_mirror'
26-
26+
TARGET_ARCH:
27+
description: '平台 amd64(默认)、arm64、arm/v7'
28+
required: false
2729
jobs:
2830
build:
2931
runs-on: ubuntu-latest
@@ -35,11 +37,15 @@ jobs:
3537

3638
- name: Pull, tag, and push Docker image
3739
run: |
38-
docker pull ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
40+
if [ "${{ github.event.inputs.TARGET_ARCH }}" != "" ]; then
41+
docker pull --platform ${{ github.event.inputs.TARGET_ARCH }} ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
42+
else
43+
docker pull ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
44+
fi
3945
docker tag ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }} ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
4046
docker push ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
4147
42-
- name: qyweixin send message
48+
- name: qyweixin send message
4349
if: ${{ env.QYWX_ROBOT_URL != '' }}
4450
uses: chf007/action-wechat-work@master
4551
env:

0 commit comments

Comments
 (0)