Skip to content

Commit

Permalink
Update docker.yaml
Browse files Browse the repository at this point in the history
Change env name.
  • Loading branch information
ClearMyFish authored Jun 14, 2024
1 parent 721c59d commit 36e7ab2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:


env:
ALIYUN_REGISTRY: "${{ secrets.ALIYUN_REGISTRY }}"
ALIYUN_NAME_SPACE: "${{ secrets.ALIYUN_NAME_SPACE }}"
ALIYUN_REGISTRY_USER: "${{ secrets.ALIYUN_REGISTRY_USER }}"
ALIYUN_REGISTRY_PASSWORD: "${{ secrets.ALIYUN_REGISTRY_PASSWORD }}"
GITLAB_REGISTRY: "${{ secrets.GITLAB_REGISTRY }}"
GITLAB_NAME_SPACE: "${{ secrets.GITLAB_NAME_SPACE }}"
GITLAB_REGISTRY_USER: "${{ secrets.GITLAB_REGISTRY_USER }}"
GITLAB_REGISTRY_PASSWORD: "${{ secrets.GITLAB_REGISTRY_PASSWORD }}"

jobs:

Expand Down Expand Up @@ -55,9 +55,9 @@ jobs:
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push image Aliyun
- name: Build and push image gitlab
run: |
docker login -u $ALIYUN_REGISTRY_USER -p $ALIYUN_REGISTRY_PASSWORD $ALIYUN_REGISTRY
docker login -u $GITLAB_REGISTRY_USER -p $GITLAB_REGISTRY_PASSWORD $GITLAB_REGISTRY
# 数据预处理,判断镜像是否重名
declare -A duplicate_images
declare -A temp_map
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
# 将@sha256:等字符删除
image_name_tag="${image_name_tag%%@*}"
new_image="$ALIYUN_REGISTRY/$ALIYUN_NAME_SPACE/$platform_prefix$name_space_prefix$image_name_tag"
new_image="$GITLAB_REGISTRY/$GITLAB_NAME_SPACE/$platform_prefix$name_space_prefix$image_name_tag"
echo "docker tag $image $new_image"
docker tag $image $new_image
echo "docker push $new_image"
Expand Down

0 comments on commit 36e7ab2

Please sign in to comment.