File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,28 @@ jobs:
4141 username : ${{ secrets.DOCKER_USERNAME }}
4242 password : ${{ secrets.DOCKER_PASSWORD }}
4343
44- - uses : docker/build-push-action@v2
44+ - name : Login to Github Container Registry
45+ uses : docker/login-action@v1
46+ with :
47+ registry : ghcr.io
48+ username : ${{ github.actor }}
49+ password : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Set docker tag list to include DockerHub if credentials available
4552 if : env.DOCKER_USERNAME != null
53+ run : |
54+ echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }},${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
55+
56+ - name : Set docker tag list to not include DockerHub if credentials not available
57+ if : env.DOCKER_USERNAME == null
58+ run : |
59+ echo "DOCKER_TAG_LIST=ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}" >> $GITHUB_ENV
60+
61+ - name : Build and Push to container registry
62+ uses : docker/build-push-action@v2
4663 with :
4764 push : true
48- tags : ${{ github.repository }}:${{ env.DOCKER_TAG }}
65+ tags : ${{ env.DOCKER_TAG_LIST }}
4966
5067 - name : Send Compile action
5168 run : |
You can’t perform that action at this time.
0 commit comments