@@ -93,36 +93,44 @@ jobs:
9393 # build the docker image, this will always run to make sure
9494 # the Dockerfile still works.
9595 - name : Build image
96- run : |
97- docker build \
98- --build-arg BRANCH=${GITHUB_BRANCH} \
99- --build-arg VERSION=${CLOWDER_VERSION} \
100- --build-arg BUILDNUMBER=${{ github.run_number }} \
101- --build-arg GITSHA1=${{ github.sha }} \
102- --tag image ${{ matrix.FOLDER }}
103-
104- # this will publish to the actor (person) github packages
105- - name : Publish to GitHub
106- if : github.event_name == 'push'
107- 96+ 10897 env :
10998 BRANCH : ${{ env.GITHUB_BRANCH }}
11099 VERSION : ${{ env.CLOWDER_VERSION }}
111100 BUILDNUMBER : ${{ github.run_number }}
112101 GITSHA1 : ${{ github.sha }}
113102 with :
114- name : ${{ github.repository_owner }}/clowder/${{ matrix.IMAGE }}
103+ registry : docker.pkg.github.com
104+ name : ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ matrix.IMAGE }}
115105 username : ${{ github.actor }}
116106 password : ${{ secrets.GITHUB_TOKEN }}
117107 context : ${{ matrix.FOLDER }}
108+ tags : " ${{ env.TAGS }}"
109+ buildargs : BRANCH,VERSION,BUILDNUMBER,GITSHA1
110+ no_push : true
111+
112+ # this will publish to github container registry
113+ - name : Publish to GitHub
114+ if : github.event_name != 'pull_request' && github.repository == env.MASTER_REPO
115+ 116+ env :
117+ BRANCH : ${{ env.GITHUB_BRANCH }}
118+ VERSION : ${{ env.CLOWDER_VERSION }}
119+ BUILDNUMBER : ${{ github.run_number }}
120+ GITSHA1 : ${{ github.sha }}
121+ with :
122+ registry : ghcr.io
123+ name : ${{ github.repository_owner }}/${{ matrix.IMAGE }}
124+ username : ${{ secrets.GHCR_USERNAME }}
125+ password : ${{ secrets.GHCR_PASSWORD }}
126+ context : ${{ matrix.FOLDER }}
118127 tags : " ${{ env.CLOWDER_TAGS }}"
119- registry : docker.pkg.github.com
120128 buildargs : BRANCH,VERSION,BUILDNUMBER,GITSHA1
121129
122130 # this will publish to the clowder dockerhub repo
123131 - name : Publish to Docker Hub
124- if : github.event_name == 'push ' && github.repository == env.MASTER_REPO
125- uses : elgohr/Publish-Docker-Github-Action@2.18
132+ if : github.event_name != 'pull_request ' && github.repository == env.MASTER_REPO
133+ uses : elgohr/Publish-Docker-Github-Action@2.22
126134 env :
127135 BRANCH : ${{ env.GITHUB_BRANCH }}
128136 VERSION : ${{ env.CLOWDER_VERSION }}
0 commit comments