File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 1- name : Docker Iamge CI for GHCR
1+ name : Docker Image CI for GHCR
22
33on :
44 push :
55 tags :
66 - ' v*.*.*'
7- pull_request :
8- tags :
9- - ' v*.*.*'
107
118jobs :
12-
139 build_and_publish :
1410 runs-on : ubuntu-latest
1511 steps :
1612 - uses : actions/checkout@v4
17- - name : Build the push the image
13+
14+ - name : Convert repository name to lowercase
15+ run : echo "LOWER_REPO_NAME=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
16+
17+ - name : Login to GitHub Container Registry
18+ run : docker login --username zhou-jianwen --password ${{ secrets.GH_PAT }} ghcr.io
19+
20+ - name : Build and push the image
1821 run : |
19- docker login --username zhou-jianwen --password ${{ secrets.GH_PAT}} ghcr.io
20- docker build . --file build/Dockerfile --tag ghcr.io/${{ github.repository }}:${{ github.ref_name }}
21- docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}
22+ docker build . --file build/Dockerfile --tag ghcr.io/$LOWER_REPO_NAME:${{ github.ref_name }}
23+ docker push ghcr.io/$LOWER_REPO_NAME:${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments