Skip to content

Commit

Permalink
Merge pull request #121 from 01-ai/fancy/debug-ci-output
Browse files Browse the repository at this point in the history
Sync docker image to public registry
  • Loading branch information
shiyue-loop authored Nov 14, 2023
2 parents 03de15d + 994c675 commit 0fd3d5b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
build-docker-image:
needs: authorize
runs-on: public
outputs:
matrix: ${{ steps.build-and-push.outputs.matrix }}
steps:
- uses: actions/checkout@v3
# try to create a tag
Expand Down Expand Up @@ -57,3 +59,33 @@ jobs:
tags: ${{ steps.read_version.outputs.value }}
username: ${{ secrets.DEFAULT_REGISTRY_USER }}
password: ${{ secrets.DEFAULT_REGISTRY_PASSWORD }}

sync-docker-images-to-public-registry:
needs: build-docker-image
strategy:
matrix: ${{ fromJSON(needs.build-docker-image.outputs.matrix) }}
runs-on: public
steps:
- id: meta
run: |
echo "src_path=$(echo '${{ matrix.tag }}' | cut -d '/' -f3- | cut -d ':' -f1 )" >> "$GITHUB_OUTPUT"
echo "src_tag=$(echo '${{ matrix.tag }}' | cut -d ':' -f2 )" >> "$GITHUB_OUTPUT"
- name: Checkout Actions
uses: actions/checkout@v3
with:
repository: 01-ai/actions
token: ${{ secrets.PAT_TO_CLONE_ACTIONS }}
path: actions
ref: main
- uses: ./actions/sync_docker_image
with:
src_registry: ${{ secrets.DEFAULT_REGISTRY }}
src_namespace: ci
src_path: ${{ steps.meta.outputs.src_path }}
src_tag: ${{ steps.meta.outputs.src_tag }}
src_username: ${{ secrets.DEFAULT_REGISTRY_USER }}
src_password: ${{ secrets.DEFAULT_REGISTRY_PASSWORD }}
dest_registry: ${{ secrets.PUBLIC_REGISTRY }}
dest_namespace: ci
dest_username: ${{ secrets.PUBLIC_REGISTRY_USER }}
dest_password: ${{ secrets.PUBLIC_REGISTRY_PASSWORD }}

0 comments on commit 0fd3d5b

Please sign in to comment.