diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index befb3ca69f..1400dd9435 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -212,34 +212,34 @@ jobs: uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 ########## ACRs ########## - - name: Login to Azure - PROD Subscription - uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 - with: - creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} + # - name: Login to Azure - PROD Subscription + # uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 + # with: + # creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} - - name: Login to PROD ACR - run: az acr login -n ${_AZ_REGISTRY%.azurecr.io} + # - name: Login to PROD ACR + # run: az acr login -n ${_AZ_REGISTRY%.azurecr.io} - - name: Login to Azure - CI Subscription - uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 - with: - creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} + # - name: Login to Azure - CI Subscription + # uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 + # with: + # creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} - - name: Retrieve github PAT secrets - id: retrieve-secret-pat - uses: bitwarden/gh-actions/get-keyvault-secrets@main - with: - keyvault: "bitwarden-ci" - secrets: "github-pat-bitwarden-devops-bot-repo-scope" + # - name: Retrieve github PAT secrets + # id: retrieve-secret-pat + # uses: bitwarden/gh-actions/get-keyvault-secrets@main + # with: + # keyvault: "bitwarden-ci" + # secrets: "github-pat-bitwarden-devops-bot-repo-scope" - - name: Generate image full name - id: image-name - run: | - IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name - if [[ "$IMAGE_TAG" == "master" ]]; then - IMAGE_TAG=dev - fi - echo "name=${_AZ_REGISTRY}/build:${IMAGE_TAG}" >> $GITHUB_OUTPUT + # - name: Generate image full name + # id: image-name + # run: | + # IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name + # if [[ "$IMAGE_TAG" == "master" ]]; then + # IMAGE_TAG=dev + # fi + # echo "name=${_AZ_REGISTRY}/build:${IMAGE_TAG}" >> $GITHUB_OUTPUT - name: Build Docker image uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 @@ -250,10 +250,18 @@ jobs: linux/amd64, linux/arm/v7, linux/arm64 - push: true - tags: ${{ steps.image-name.outputs.name }} - secrets: | - "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" + # push: true + outputs: type=docker,dest=/tmp/build.tar + # tags: ${{ steps.image-name.outputs.name }} + tags: build:latest + # secrets: | + # "GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}" + + - name: Upload artifact + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: build + path: /tmp/build.tar build-docker: name: Build Docker images @@ -366,18 +374,28 @@ jobs: PROJECT_NAME: ${{ steps.setup.outputs.project_name }} run: echo "name=${_AZ_REGISTRY}/${PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT + - name: Download build image artifact + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: build + path: /tmp + + - name: Load build image + run: | + docker load --input /tmp/build.tar + docker image ls -a + - name: Build Docker image uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: - build-args: | - BUILD_TAG=${{ steps.tag.outputs.image_tag }} + # build-args: | + # BUILD_TAG=${{ steps.tag.outputs.image_tag }} context: ${{ matrix.base_path }}/${{ matrix.project_name }} file: ${{ matrix.base_path }}/${{ matrix.project_name }}/Dockerfile platforms: | linux/amd64, linux/arm/v7, linux/arm64 - pull: true push: true tags: ${{ steps.image-name.outputs.name }} secrets: | diff --git a/bitwarden_license/src/Scim/Dockerfile b/bitwarden_license/src/Scim/Dockerfile index e96e000666..0d85d8a284 100644 --- a/bitwarden_license/src/Scim/Dockerfile +++ b/bitwarden_license/src/Scim/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/bitwarden_license/src/Sso/Dockerfile b/bitwarden_license/src/Sso/Dockerfile index e3927e2f12..0aad4442c0 100644 --- a/bitwarden_license/src/Sso/Dockerfile +++ b/bitwarden_license/src/Sso/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Admin/Dockerfile b/src/Admin/Dockerfile index 0d3b9578ba..07830a30b4 100644 --- a/src/Admin/Dockerfile +++ b/src/Admin/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Api/Dockerfile b/src/Api/Dockerfile index 7e5b68df7e..1a558c8e5d 100644 --- a/src/Api/Dockerfile +++ b/src/Api/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Billing/Dockerfile b/src/Billing/Dockerfile index b651ea59f2..a0d9b16367 100644 --- a/src/Billing/Dockerfile +++ b/src/Billing/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Events/Dockerfile b/src/Events/Dockerfile index 52f4f80390..b4f5bc3a03 100644 --- a/src/Events/Dockerfile +++ b/src/Events/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/EventsProcessor/Dockerfile b/src/EventsProcessor/Dockerfile index 15388a9ea9..ede264a2be 100644 --- a/src/EventsProcessor/Dockerfile +++ b/src/EventsProcessor/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Icons/Dockerfile b/src/Icons/Dockerfile index 3cf662b55a..f5e578f532 100644 --- a/src/Icons/Dockerfile +++ b/src/Icons/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Identity/Dockerfile b/src/Identity/Dockerfile index 83c822d2b2..8c52c8420a 100644 --- a/src/Identity/Dockerfile +++ b/src/Identity/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/src/Notifications/Dockerfile b/src/Notifications/Dockerfile index 633bc23802..3ca5c3ae53 100644 --- a/src/Notifications/Dockerfile +++ b/src/Notifications/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/util/Attachments/Dockerfile b/util/Attachments/Dockerfile index 4c620e994b..5c2b48c1f6 100644 --- a/util/Attachments/Dockerfile +++ b/util/Attachments/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/util/Server/Dockerfile b/util/Server/Dockerfile index b052a82ff0..e6380d5f00 100644 --- a/util/Server/Dockerfile +++ b/util/Server/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage # diff --git a/util/Setup/Dockerfile b/util/Setup/Dockerfile index 99182f6d6a..2045d52de9 100644 --- a/util/Setup/Dockerfile +++ b/util/Setup/Dockerfile @@ -2,7 +2,7 @@ # Build stage # ############################################### ARG BUILD_TAG=latest -FROM --platform=$BUILDPLATFORM bitwardenprod.azurecr.io/build:${BUILD_TAG} AS bitwarden-build +FROM --platform=$BUILDPLATFORM build:${BUILD_TAG} AS bitwarden-build ############################################### # App stage #