2021-09-02 22:05:17 +02:00
|
|
|
---
|
2022-06-03 16:35:46 +02:00
|
|
|
name: Build Web
|
2020-12-21 18:46:36 +01:00
|
|
|
|
|
|
|
on:
|
2022-06-03 16:35:46 +02:00
|
|
|
pull_request:
|
2020-12-21 18:46:36 +01:00
|
|
|
branches-ignore:
|
2022-06-03 16:35:46 +02:00
|
|
|
- 'l10n_master'
|
2022-06-20 21:16:51 +02:00
|
|
|
- 'cf-pages'
|
2022-06-03 16:35:46 +02:00
|
|
|
paths:
|
|
|
|
- 'apps/web/**'
|
2022-06-08 19:53:35 +02:00
|
|
|
- 'libs/**'
|
2022-06-13 09:59:15 +02:00
|
|
|
- '*'
|
|
|
|
- '!*.md'
|
|
|
|
- '!*.txt'
|
2022-06-03 16:35:46 +02:00
|
|
|
- '.github/workflows/build-web.yml'
|
|
|
|
push:
|
|
|
|
branches:
|
2023-12-12 20:57:50 +01:00
|
|
|
- 'main'
|
2022-06-03 16:35:46 +02:00
|
|
|
- 'rc'
|
2022-08-16 17:55:57 +02:00
|
|
|
- 'hotfix-rc-web'
|
2022-06-03 16:35:46 +02:00
|
|
|
paths:
|
|
|
|
- 'apps/web/**'
|
2022-06-08 19:53:35 +02:00
|
|
|
- 'libs/**'
|
2022-06-13 09:59:15 +02:00
|
|
|
- '*'
|
|
|
|
- '!*.md'
|
|
|
|
- '!*.txt'
|
2022-06-03 16:35:46 +02:00
|
|
|
- '.github/workflows/build-web.yml'
|
2024-02-08 18:13:32 +01:00
|
|
|
release:
|
|
|
|
types: [published]
|
2022-06-03 16:35:46 +02:00
|
|
|
workflow_dispatch:
|
2022-06-20 18:23:11 +02:00
|
|
|
inputs:
|
|
|
|
custom_tag_extension:
|
|
|
|
description: "Custom image tag extension"
|
|
|
|
required: false
|
2022-03-08 22:39:54 +01:00
|
|
|
|
2023-08-16 17:41:02 +02:00
|
|
|
env:
|
|
|
|
_AZ_REGISTRY: bitwardenprod.azurecr.io
|
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
jobs:
|
2021-10-08 18:54:42 +02:00
|
|
|
setup:
|
|
|
|
name: Setup
|
2022-09-19 22:38:19 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-10-08 18:54:42 +02:00
|
|
|
outputs:
|
|
|
|
version: ${{ steps.version.outputs.value }}
|
2023-10-04 18:23:40 +02:00
|
|
|
node_version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2021-10-08 18:54:42 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-10-08 18:54:42 +02:00
|
|
|
|
|
|
|
- name: Get GitHub sha as version
|
|
|
|
id: version
|
2022-12-05 16:04:04 +01:00
|
|
|
run: echo "value=${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Get Node Version
|
|
|
|
id: retrieve-node-version
|
|
|
|
run: |
|
|
|
|
NODE_NVMRC=$(cat .nvmrc)
|
|
|
|
NODE_VERSION=${NODE_NVMRC/v/''}
|
|
|
|
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
|
|
|
|
2022-09-19 22:38:19 +02:00
|
|
|
build-artifacts:
|
|
|
|
name: Build artifacts
|
|
|
|
runs-on: ubuntu-22.04
|
2023-08-16 17:41:02 +02:00
|
|
|
needs: setup
|
2021-10-08 18:54:42 +02:00
|
|
|
env:
|
|
|
|
_VERSION: ${{ needs.setup.outputs.version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2022-09-19 22:38:19 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- name: "selfhosted-open-source"
|
|
|
|
npm_command: "dist:oss:selfhost"
|
|
|
|
- name: "cloud-COMMERCIAL"
|
|
|
|
npm_command: "dist:bit:cloud"
|
|
|
|
- name: "selfhosted-COMMERCIAL"
|
|
|
|
npm_command: "dist:bit:selfhost"
|
|
|
|
- name: "cloud-QA"
|
|
|
|
npm_command: "build:bit:qa"
|
2024-02-28 20:01:15 +01:00
|
|
|
git_metadata: true
|
2022-09-29 12:21:47 +02:00
|
|
|
- name: "ee"
|
|
|
|
npm_command: "build:bit:ee"
|
2024-02-28 20:01:15 +01:00
|
|
|
git_metadata: true
|
2023-06-15 18:54:39 +02:00
|
|
|
- name: "cloud-euprd"
|
|
|
|
npm_command: "build:bit:euprd"
|
2023-06-28 22:03:30 +02:00
|
|
|
- name: "cloud-euqa"
|
|
|
|
npm_command: "build:bit:euqa"
|
2024-02-28 20:01:15 +01:00
|
|
|
git_metadata: true
|
2023-12-21 17:10:31 +01:00
|
|
|
- name: "cloud-usdev"
|
|
|
|
npm_command: "build:bit:usdev"
|
2024-02-28 20:01:15 +01:00
|
|
|
git_metadata: true
|
2022-09-19 22:38:19 +02:00
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
steps:
|
2022-03-17 14:02:50 +01:00
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
- name: Set up Node
|
2024-02-08 21:29:48 +01:00
|
|
|
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
|
2020-12-21 18:46:36 +01:00
|
|
|
with:
|
2022-03-16 16:18:47 +01:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2021-05-26 22:17:37 +02:00
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
whoami
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
gulp --version
|
|
|
|
docker --version
|
|
|
|
echo "GitHub ref: $GITHUB_REF"
|
|
|
|
echo "GitHub event: $GITHUB_EVENT"
|
|
|
|
|
2021-06-14 21:20:49 +02:00
|
|
|
- name: Install dependencies
|
2021-09-21 18:37:17 +02:00
|
|
|
run: npm ci
|
2021-06-14 21:20:49 +02:00
|
|
|
|
2024-02-28 20:01:15 +01:00
|
|
|
- name: Add Git metadata to build version
|
2022-06-03 16:35:46 +02:00
|
|
|
working-directory: apps/web
|
2024-02-28 20:01:15 +01:00
|
|
|
if: matrix.git_metadata
|
2021-09-21 18:37:17 +02:00
|
|
|
run: |
|
2022-09-19 22:38:19 +02:00
|
|
|
VERSION=$( jq -r ".version" package.json)
|
2022-11-22 15:29:59 +01:00
|
|
|
jq --arg version "$VERSION+${GITHUB_SHA:0:7}" '.version = $version' package.json > package.json.tmp
|
2022-09-19 22:38:19 +02:00
|
|
|
mv package.json.tmp package.json
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2022-09-19 22:38:19 +02:00
|
|
|
- name: Build ${{ matrix.name }}
|
|
|
|
working-directory: apps/web
|
|
|
|
run: npm run ${{ matrix.npm_command }}
|
2021-09-21 18:37:17 +02:00
|
|
|
|
2022-10-12 01:57:19 +02:00
|
|
|
- name: Package artifact
|
|
|
|
working-directory: apps/web
|
|
|
|
run: zip -r web-${{ env._VERSION }}-${{ matrix.name }}.zip build
|
|
|
|
|
2022-09-19 22:38:19 +02:00
|
|
|
- name: Upload ${{ matrix.name }} artifact
|
2024-02-08 21:00:48 +01:00
|
|
|
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
|
2021-06-14 21:20:49 +02:00
|
|
|
with:
|
2022-09-19 22:38:19 +02:00
|
|
|
name: web-${{ env._VERSION }}-${{ matrix.name }}.zip
|
2022-10-12 01:57:19 +02:00
|
|
|
path: apps/web/web-${{ env._VERSION }}-${{ matrix.name }}.zip
|
2021-09-21 18:37:17 +02:00
|
|
|
if-no-files-found: error
|
2021-06-14 21:20:49 +02:00
|
|
|
|
|
|
|
|
2022-09-29 12:21:47 +02:00
|
|
|
build-containers:
|
2023-02-17 16:36:53 +01:00
|
|
|
name: Build Docker images
|
2022-09-19 22:38:19 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-03-07 17:02:23 +01:00
|
|
|
needs:
|
|
|
|
- setup
|
2022-09-19 22:38:19 +02:00
|
|
|
- build-artifacts
|
2022-09-29 12:21:47 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- artifact_name: cloud-QA
|
2023-02-17 16:36:53 +01:00
|
|
|
image_name: web-qa-cloud
|
2022-09-29 12:21:47 +02:00
|
|
|
- artifact_name: ee
|
|
|
|
image_name: web-ee
|
2023-02-17 16:36:53 +01:00
|
|
|
- artifact_name: selfhosted-COMMERCIAL
|
|
|
|
image_name: web
|
2022-09-19 22:38:19 +02:00
|
|
|
env:
|
|
|
|
_VERSION: ${{ needs.setup.outputs.version }}
|
2021-10-08 18:54:42 +02:00
|
|
|
steps:
|
2022-03-17 14:02:50 +01:00
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Check Branch to Publish
|
|
|
|
env:
|
2023-12-12 20:57:50 +01:00
|
|
|
PUBLISH_BRANCHES: "main,rc,hotfix-rc-web"
|
2023-02-17 16:36:53 +01:00
|
|
|
id: publish-branch-check
|
|
|
|
run: |
|
|
|
|
IFS="," read -a publish_branches <<< $PUBLISH_BRANCHES
|
|
|
|
|
|
|
|
if [[ " ${publish_branches[*]} " =~ " ${GITHUB_REF:11} " ]]; then
|
|
|
|
echo "is_publish_branch=true" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "is_publish_branch=false" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
|
|
|
|
########## ACRs ##########
|
2023-08-16 17:41:02 +02:00
|
|
|
- name: Login to Prod Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2023-02-17 16:36:53 +01:00
|
|
|
with:
|
2023-08-16 17:41:02 +02:00
|
|
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
2023-02-17 16:36:53 +01:00
|
|
|
|
2023-08-16 17:41:02 +02:00
|
|
|
- name: Log into Prod container registry
|
|
|
|
run: az acr login -n bitwardenprod
|
2023-02-17 16:36:53 +01:00
|
|
|
|
2023-08-16 17:41:02 +02:00
|
|
|
- name: Login to Azure - CI Subscription
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2021-10-08 18:54:42 +02:00
|
|
|
with:
|
2023-08-16 17:41:02 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-08-16 17:41:02 +02:00
|
|
|
- name: Retrieve github PAT secrets
|
|
|
|
id: retrieve-secret-pat
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2023-08-16 17:41:02 +02:00
|
|
|
with:
|
|
|
|
keyvault: "bitwarden-ci"
|
|
|
|
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2022-09-29 12:21:47 +02:00
|
|
|
- name: Download ${{ matrix.artifact_name }} artifact
|
2024-03-06 19:49:15 +01:00
|
|
|
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
|
2022-09-19 22:38:19 +02:00
|
|
|
with:
|
2022-09-29 12:21:47 +02:00
|
|
|
name: web-${{ env._VERSION }}-${{ matrix.artifact_name }}.zip
|
2022-10-12 01:57:19 +02:00
|
|
|
path: apps/web
|
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
########## Generate image tag and build Docker image ##########
|
|
|
|
- name: Generate Docker image tag
|
|
|
|
id: tag
|
2021-12-23 15:14:10 +01:00
|
|
|
run: |
|
2022-08-05 21:33:08 +02:00
|
|
|
if [[ $(grep "pull" <<< "${GITHUB_REF}") ]]; then
|
2022-08-08 19:10:18 +02:00
|
|
|
IMAGE_TAG=$(echo "${GITHUB_HEAD_REF}" | sed "s#/#-#g")
|
2022-08-05 21:33:08 +02:00
|
|
|
else
|
2024-02-08 18:13:32 +01:00
|
|
|
IMAGE_TAG=$(echo "${GITHUB_REF_NAME}" | sed "s#/#-#g")
|
2022-08-05 21:33:08 +02:00
|
|
|
fi
|
|
|
|
|
2023-12-12 20:57:50 +01:00
|
|
|
if [[ "$IMAGE_TAG" == "main" ]]; then
|
2023-03-22 20:52:15 +01:00
|
|
|
IMAGE_TAG=dev
|
|
|
|
fi
|
|
|
|
|
2021-12-23 15:14:10 +01:00
|
|
|
TAG_EXTENSION=${{ github.event.inputs.custom_tag_extension }}
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2021-12-23 15:14:10 +01:00
|
|
|
if [[ $TAG_EXTENSION ]]; then
|
|
|
|
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
|
|
|
|
fi
|
2022-08-05 21:33:08 +02:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
########## Build Image ##########
|
|
|
|
- name: Extract artifact
|
|
|
|
working-directory: apps/web
|
|
|
|
run: unzip web-${{ env._VERSION }}-${{ matrix.artifact_name }}.zip
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-08-16 17:41:02 +02:00
|
|
|
- name: Generate image full name
|
|
|
|
id: image-name
|
|
|
|
env:
|
|
|
|
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
|
|
|
|
PROJECT_NAME: ${{ matrix.image_name }}
|
|
|
|
run: echo "name=$_AZ_REGISTRY/${PROJECT_NAME}:${IMAGE_TAG}" >> $GITHUB_OUTPUT
|
2023-02-17 16:36:53 +01:00
|
|
|
|
|
|
|
- name: Build Docker image
|
2024-02-08 21:30:06 +01:00
|
|
|
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
|
2023-02-17 16:36:53 +01:00
|
|
|
with:
|
|
|
|
context: apps/web
|
|
|
|
file: apps/web/Dockerfile
|
|
|
|
platforms: linux/amd64
|
|
|
|
push: true
|
2023-08-16 17:41:02 +02:00
|
|
|
tags: ${{ steps.image-name.outputs.name }}
|
2023-02-17 16:36:53 +01:00
|
|
|
secrets: |
|
|
|
|
"GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}"
|
|
|
|
|
2021-10-08 18:54:42 +02:00
|
|
|
- name: Log out of Docker
|
|
|
|
run: docker logout
|
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
|
2021-11-04 19:15:29 +01:00
|
|
|
crowdin-push:
|
|
|
|
name: Crowdin Push
|
2023-12-12 20:57:50 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2023-08-16 17:41:02 +02:00
|
|
|
needs: build-artifacts
|
2022-09-19 22:38:19 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-11-04 19:15:29 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2021-11-04 19:15:29 +01:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2021-11-04 19:15:29 +01:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2021-11-04 19:15:29 +01:00
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-13 21:38:47 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-13 21:38:47 +02:00
|
|
|
secrets: "crowdin-api-token"
|
2021-11-04 19:15:29 +01:00
|
|
|
|
|
|
|
- name: Upload Sources
|
2024-03-06 19:49:15 +01:00
|
|
|
uses: crowdin/github-action@c953b17499daa6be3e5afbf7a63616fb02d8b18d # v1.19.0
|
2021-11-04 19:15:29 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
|
2022-06-13 09:59:15 +02:00
|
|
|
CROWDIN_PROJECT_ID: "308189"
|
2021-11-04 19:15:29 +01:00
|
|
|
with:
|
2022-06-03 16:35:46 +02:00
|
|
|
config: apps/web/crowdin.yml
|
2023-12-12 20:57:50 +01:00
|
|
|
crowdin_branch_name: main
|
2021-11-04 19:15:29 +01:00
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
|
2024-01-03 16:48:51 +01:00
|
|
|
trigger-web-vault-deploy:
|
|
|
|
name: Trigger web vault deploy
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: build-artifacts
|
|
|
|
steps:
|
|
|
|
- name: Login to Azure - CI Subscription
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2024-01-03 16:48:51 +01:00
|
|
|
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: Trigger web vault deploy
|
2024-02-08 20:44:13 +01:00
|
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
2024-01-03 16:48:51 +01:00
|
|
|
with:
|
|
|
|
github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
|
|
|
|
script: |
|
|
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
|
|
owner: 'bitwarden',
|
|
|
|
repo: 'clients',
|
|
|
|
workflow_id: 'deploy-web.yml',
|
|
|
|
ref: 'main',
|
|
|
|
inputs: {
|
2024-01-05 18:05:11 +01:00
|
|
|
'environment': 'USDEV',
|
|
|
|
'branch-or-tag': 'main'
|
2024-01-03 16:48:51 +01:00
|
|
|
}
|
|
|
|
})
|
2022-03-08 22:39:54 +01:00
|
|
|
|
2021-10-14 20:34:31 +02:00
|
|
|
check-failures:
|
|
|
|
name: Check for failures
|
|
|
|
if: always()
|
2022-09-19 22:38:19 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-10-14 20:34:31 +02:00
|
|
|
needs:
|
|
|
|
- setup
|
2022-09-19 22:38:19 +02:00
|
|
|
- build-artifacts
|
2022-10-11 16:46:36 +02:00
|
|
|
- build-containers
|
2021-11-04 19:15:29 +01:00
|
|
|
- crowdin-push
|
2024-01-03 16:48:51 +01:00
|
|
|
- trigger-web-vault-deploy
|
2021-10-14 20:34:31 +02:00
|
|
|
steps:
|
|
|
|
- name: Check if any job failed
|
2024-03-06 14:59:18 +01:00
|
|
|
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc') && contains(needs.*.result, 'failure')
|
|
|
|
run: exit 1
|
2021-10-14 20:34:31 +02:00
|
|
|
|
|
|
|
- name: Login to Azure - Prod Subscription
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2021-10-14 20:34:31 +02:00
|
|
|
if: failure()
|
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2021-10-14 20:34:31 +02:00
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
|
|
|
if: failure()
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-13 21:38:47 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-13 21:38:47 +02:00
|
|
|
secrets: "devops-alerts-slack-webhook-url"
|
2021-10-14 20:34:31 +02:00
|
|
|
|
|
|
|
- name: Notify Slack on failure
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0
|
2021-10-14 20:34:31 +02:00
|
|
|
if: failure()
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|