Push web docker images to bitwardenprod ACR (#4749)

This commit is contained in:
Michał Chęciński 2023-02-14 20:39:17 +01:00 committed by GitHub
parent 5dc1775cfc
commit cace42fe12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

@ -222,11 +222,11 @@ jobs:
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
- name: Login to Azure ACR
run: az acr login -n bitwardenqa
run: az acr login -n bitwardenprod
- name: Tag and Push to Azure QA ACR
env:
REGISTRY: bitwardenqa.azurecr.io
REGISTRY: bitwardenprod.azurecr.io
run: |
if [[ $(grep "pull" <<< "${GITHUB_REF}") ]]; then
IMAGE_TAG=$(echo "${GITHUB_HEAD_REF}" | sed "s#/#-#g")
@ -247,7 +247,7 @@ jobs:
run: docker logout
build-containers:
name: Build Docker images for bitwardenqa
name: Build Docker images for bitwardenprod
runs-on: ubuntu-22.04
needs:
- setup
@ -269,10 +269,10 @@ jobs:
- name: Login to Azure
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
with:
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Log into container registry
run: az acr login -n bitwardenqa
run: az acr login -n bitwardenprod
- name: Download ${{ matrix.artifact_name }} artifact
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
@ -288,7 +288,7 @@ jobs:
working-directory: apps/web
run: |
docker --version
docker build -t bitwardenqa.azurecr.io/${{ matrix.image_name }} .
docker build -t bitwardenprod.azurecr.io/${{ matrix.image_name }} .
- name: Get image tag
id: image-tag
@ -311,25 +311,25 @@ jobs:
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
IMAGE_NAME: ${{ matrix.image_name }}
run: docker tag bitwardenqa.azurecr.io/$IMAGE_NAME "bitwardenqa.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"
run: docker tag bitwardenprod.azurecr.io/$IMAGE_NAME "bitwardenprod.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"
- name: Tag dev
if: github.ref == 'refs/heads/master'
env:
IMAGE_NAME: ${{ matrix.image_name }}
run: docker tag bitwardenqa.azurecr.io/$IMAGE_NAME "bitwardenqa.azurecr.io/$IMAGE_NAME:dev"
run: docker tag bitwardenprod.azurecr.io/$IMAGE_NAME "bitwardenprod.azurecr.io/$IMAGE_NAME:dev"
- name: Push image
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
IMAGE_NAME: ${{ matrix.image_name }}
run: docker push "bitwardenqa.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"
run: docker push "bitwardenprod.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"
- name: Push dev images
if: github.ref == 'refs/heads/master'
env:
IMAGE_NAME: ${{ matrix.image_name }}
run: docker push "bitwardenqa.azurecr.io/$IMAGE_NAME:dev"
run: docker push "bitwardenprod.azurecr.io/$IMAGE_NAME:dev"
- name: Log out of Docker
run: docker logout

View File

@ -107,14 +107,14 @@ jobs:
- name: Login to Azure - QA Subscription
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
with:
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Login to Azure ACR
run: az acr login -n bitwardenqa
run: az acr login -n bitwardenprod
- name: Tag version
env:
REGISTRY: bitwardenqa.azurecr.io
REGISTRY: bitwardenprod.azurecr.io
run: |
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
docker tag bitwarden/web:latest $REGISTRY/web:$_RELEASE_VERSION
@ -129,7 +129,7 @@ jobs:
- name: Push version
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
env:
REGISTRY: bitwardenqa.azurecr.io
REGISTRY: bitwardenprod.azurecr.io
run: |
docker push $REGISTRY/web:$_RELEASE_VERSION