@@ -56,14 +56,19 @@ jobs:
5656 push : true
5757 tags : bitwardenqa.azurecr.io/self-host:${{ steps.tag.outputs.image_tag }}
5858
59+ - name : Pull new image
60+ env :
61+ PROJECT_NAME : self-host
62+ IMAGE_TAG : ${{ steps.tag.outputs.image_tag }}
63+ run : docker pull bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG}
64+
5965 - name : Log out of Docker
6066 run : docker logout
6167
6268 # ######### DockerHub ##########
6369 - name : Login to Azure - Prod Subscription
6470 if : |
65- false
66- && (github.ref == 'refs/heads/master' ||
71+ (github.ref == 'refs/heads/master' ||
6772 github.ref == 'refs/heads/rc' ||
6873 github.ref == 'refs/heads/hotfix-rc')
6974 uses : Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
7277
7378 - name : Retrieve secrets
7479 if : |
75- false
76- && (github.ref == 'refs/heads/master' ||
80+ (github.ref == 'refs/heads/master' ||
7781 github.ref == 'refs/heads/rc' ||
7882 github.ref == 'refs/heads/hotfix-rc')
7983 id : retrieve-secrets
8791
8892 - name : Log into Docker
8993 if : |
90- false
91- && (github.ref == 'refs/heads/master' ||
94+ (github.ref == 'refs/heads/master' ||
9295 github.ref == 'refs/heads/rc' ||
9396 github.ref == 'refs/heads/hotfix-rc')
9497 env :
@@ -112,29 +115,22 @@ jobs:
112115 echo "DOCKER_CONTENT_TRUST=1" >> $GITHUB_ENV
113116 echo "DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$DCT_REPO_PASSPHRASE" >> $GITHUB_ENV
114117
115- - name : Tag and Push RC to Docker Hub
118+ - name : Tag and Push image to Docker Hub
116119 if : |
117- false
118- && (github.ref == 'refs/heads/master' ||
120+ (github.ref == 'refs/heads/master' ||
119121 github.ref == 'refs/heads/rc' ||
120122 github.ref == 'refs/heads/hotfix-rc')
121123 env :
122124 PROJECT_NAME : self-host
123- REGISTRY : bitwarden
125+ IMAGE_TAG : ${{ steps.tag.outputs.image_tag }}
124126 run : |
125- IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name
126- if [[ "$IMAGE_TAG" == "master" ]]; then
127- IMAGE_TAG=dev
128- fi
129-
130- docker tag $PROJECT_NAME \
131- $REGISTRY/$PROJECT_NAME:$IMAGE_TAG
132- docker push $REGISTRY/$PROJECT_NAME:$IMAGE_TAG
127+ docker tag bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG} \
128+ bitwarden/${PROJECT_NAME}:${IMAGE_TAG}
129+ docker push bitwarden/${PROJECT_NAME}:${IMAGE_TAG}
133130
134131 - name : Log out of Docker and disable Docker Notary
135132 if : |
136- false
137- && (github.ref == 'refs/heads/master' ||
133+ (github.ref == 'refs/heads/master' ||
138134 github.ref == 'refs/heads/rc' ||
139135 github.ref == 'refs/heads/hotfix-rc')
140136 run : |
0 commit comments