diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1f644968..2516f63e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,20 +16,31 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Extract version tag - id: extract_tag - run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: Log in to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to ACR + uses: docker/login-action@v2 + with: + username: ${{ secrets.ACR_USERNAME }} + password: ${{ secrets.ACR_PASSWORD }} + registry: ${{ secrets.ACR_REGISTRY }} + + - name: Extract Docker metadata (tags, labels) + id: meta + uses: docker/metadata-action@v4 + with: + images: | + opencsg/csghub-server + ${{ secrets.ACR_REGISTRY }}/opencsg_public/csghub_server + - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . file: ./docker/Dockerfile push: true - tags: opencsg/csghub-server:${{ env.TAG }} + tags: ${{ steps.meta.outputs.tags }}