File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,25 @@ jobs:
2828 username : ${{ secrets.DOCKERHUB_USERNAME }}
2929 password : ${{ secrets.DOCKERHUB_TOKEN }}
3030
31+ - name : Extract tag name from GHCR
32+ id : extract
33+ run : |
34+ TAG=$(echo "${{ inputs.image_uri }}" | cut -d':' -f2)
35+ echo "tag=${TAG}" >> $GITHUB_OUTPUT
36+
37+ APP_NAME=$(echo "${{ inputs.image_uri }}" | cut -d'/' -f3 | cut -d':' -f1)
38+ echo "app_name=${APP_NAME}" >> $GITHUB_OUTPUT
39+
3140 - name : Pull -> re-tag -> push
3241 id : push
3342 run : |
34- DOCKERHUB_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/mi-app:latest "
43+ DOCKERHUB_IMAGE="${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.extract.outputs.app_name }}:${{ steps.extract.outputs.tag }} "
3544 docker pull ${{ inputs.image_uri }}
45+
3646 docker tag ${{ inputs.image_uri }} $DOCKERHUB_IMAGE
47+
3748 docker push $DOCKERHUB_IMAGE
49+
3850 echo "image_uri=$DOCKERHUB_IMAGE" >> $GITHUB_OUTPUT
3951
4052 deploy :
You can’t perform that action at this time.
0 commit comments