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 99 branches : [ orange-master ]
1010 workflow_dispatch :
1111
12+
1213env :
1314 DOCKER_FILE_PATH : .
1415 IMAGE : " ghcr.io/${{ github.repository }}"
16+ DOCKERHUB_ORG : elpaasoci
17+
1518jobs :
1619 build_and_publish :
1720 name : build and publish
@@ -21,21 +24,34 @@ jobs:
2124
2225 steps :
2326 - uses : actions/checkout@v4
27+ -
28+ name : Login to DockerHub
29+ uses : docker/login-action@v3
30+ with :
31+ username : ${{ secrets.DOCKERHUB_USERNAME }}
32+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
2433 -
2534 name : Login to GitHub Container Registry
2635 uses : docker/login-action@v3
2736 with :
2837 registry : ghcr.io
2938 username : ${{ github.actor }}
3039 password : ${{ secrets.GITHUB_TOKEN }}
31-
40+ -
41+ name : extract github repo name
42+ id : gh-repo-name
43+ run : |
44+ echo "OCI_IMAGE=$(basename ${{ github.repository }})" >> $GITHUB_ENV
45+ shell : bash
3246 -
3347 name : publish image
3448 uses : docker/build-push-action@v5.1.0
3549 with :
3650 context : ${{env.DOCKER_FILE_PATH}}
3751 push : true
3852 tags : |
53+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:latest
54+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.sha}}
3955 ${{ env.IMAGE}}:latest
4056 ${{ env.IMAGE}}:${{github.sha}}
4157 -
4662 push : true
4763 context : ${{ env.DOCKER_FILE_PATH }}
4864 tags : |
49- ${{ env.IMAGE}}:${{github.ref_name}}
65+ ${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.ref_name}}
66+ ${{env.IMAGE}}:${{github.ref_name}}
You can’t perform that action at this time.
0 commit comments