Skip to content

Commit

Permalink
增加平台参数
Browse files Browse the repository at this point in the history
  • Loading branch information
lltx authored Jun 13, 2024
1 parent 7c10f90 commit a425601
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/mirror.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ on:
description: '空间名称'
required: true
default: 'dockerhub_mirror'

TARGET_ARCH:
description: '平台 amd64(默认)、arm64、arm/v7'
required: false
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -35,11 +37,15 @@ jobs:

- name: Pull, tag, and push Docker image
run: |
docker pull ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
if [ "${{ github.event.inputs.TARGET_ARCH }}" != "" ]; then
docker pull --platform ${{ github.event.inputs.TARGET_ARCH }} ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
else
docker pull ${{ github.event.inputs.IMAGE_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
fi
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 }}
docker push ${{ github.event.inputs.TARGET_REGISTRY }}/${{ github.event.inputs.TARGET_REPOSITORY }}/${{ github.event.inputs.NEW_NAME }}:${{ github.event.inputs.IMAGE_VERSION }}
- name: qyweixin send message
- name: qyweixin send message
if: ${{ env.QYWX_ROBOT_URL != '' }}
uses: chf007/action-wechat-work@master
env:
Expand Down

0 comments on commit a425601

Please sign in to comment.