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:
|
|
|
|
- 'master'
|
|
|
|
- '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'
|
|
|
|
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
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
jobs:
|
|
|
|
cloc:
|
2021-06-14 21:20:49 +02:00
|
|
|
name: CLOC
|
2022-09-19 22:38:19 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2020-12-21 18:46:36 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
2020-12-21 18:46:36 +01:00
|
|
|
|
|
|
|
- name: Set up cloc
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt -y install cloc
|
|
|
|
|
|
|
|
- name: Print lines of code
|
2022-06-03 16:35:46 +02:00
|
|
|
working-directory: apps/web
|
2020-12-21 18:46:36 +01:00
|
|
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
|
|
|
|
2022-03-08 22:39:54 +01:00
|
|
|
|
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 }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
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
|
|
|
|
2022-09-19 22:38:19 +02:00
|
|
|
build-artifacts:
|
|
|
|
name: Build artifacts
|
|
|
|
runs-on: ubuntu-22.04
|
2022-03-07 17:02:23 +01:00
|
|
|
needs:
|
|
|
|
- setup
|
2021-10-08 18:54:42 +02:00
|
|
|
env:
|
|
|
|
_VERSION: ${{ needs.setup.outputs.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"
|
2023-03-21 17:24:22 +01:00
|
|
|
- name: "cloud-POC2"
|
2023-01-26 22:38:41 +01:00
|
|
|
npm_command: "build:bit:poc"
|
2022-09-29 12:21:47 +02:00
|
|
|
- name: "ee"
|
|
|
|
npm_command: "build:bit:ee"
|
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
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
- name: Set up Node
|
2022-09-19 22:38:19 +02:00
|
|
|
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # v3.4.1
|
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'
|
2021-12-13 17:16:57 +01:00
|
|
|
node-version: "16"
|
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
|
|
|
|
2022-09-19 22:38:19 +02:00
|
|
|
- name: Setup QA metadata
|
2022-06-03 16:35:46 +02:00
|
|
|
working-directory: apps/web
|
2022-09-19 22:38:19 +02:00
|
|
|
if: matrix.name == 'cloud-QA'
|
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
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
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
|
|
|
registries: [bitwardenprod.azurecr.io, bitwardenqa.azurecr.io]
|
|
|
|
image_name: web-qa-cloud
|
2022-09-29 12:21:47 +02:00
|
|
|
- artifact_name: ee
|
2023-02-17 16:36:53 +01:00
|
|
|
registries: [bitwardenprod.azurecr.io, bitwardenqa.azurecr.io]
|
2022-09-29 12:21:47 +02:00
|
|
|
image_name: web-ee
|
2023-02-17 16:36:53 +01:00
|
|
|
- artifact_name: selfhosted-COMMERCIAL
|
|
|
|
registries: [bitwarden, bitwardenprod.azurecr.io, bitwardenqa.azurecr.io]
|
|
|
|
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
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Check Branch to Publish
|
|
|
|
env:
|
|
|
|
PUBLISH_BRANCHES: "master,rc,hotfix-rc"
|
|
|
|
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 ##########
|
|
|
|
- name: Login to Azure - QA
|
|
|
|
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Log into QA container registry
|
|
|
|
run: az acr login -n bitwardenqa
|
|
|
|
|
|
|
|
- name: Login to Azure - Prod
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
|
2021-10-08 18:54:42 +02:00
|
|
|
with:
|
2023-02-14 20:39:17 +01:00
|
|
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Log into Prod container registry
|
2023-02-14 20:39:17 +01:00
|
|
|
run: az acr login -n bitwardenprod
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2022-09-29 12:21:47 +02:00
|
|
|
- name: Download ${{ matrix.artifact_name }} artifact
|
2022-09-19 22:38:19 +02:00
|
|
|
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
|
|
|
|
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
|
|
|
|
IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g")
|
|
|
|
fi
|
|
|
|
|
2023-03-22 20:52:15 +01:00
|
|
|
if [[ "$IMAGE_TAG" == "master" ]]; then
|
|
|
|
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
|
|
|
- name: Generate tag list
|
|
|
|
id: tag-list
|
2021-12-23 15:14:10 +01:00
|
|
|
env:
|
2023-02-17 16:36:53 +01:00
|
|
|
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
|
|
|
|
PROJECT_NAME: ${{ matrix.image_name }}
|
|
|
|
run: echo "tags=bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG},bitwardenprod.azurecr.io/${PROJECT_NAME}:${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-04-11 18:37:58 +02:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Retrieve github PAT secrets
|
|
|
|
id: retrieve-secret-pat
|
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c3b3285993151c5af47cefcb3b9134c28ab479af
|
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2023-02-17 16:36:53 +01:00
|
|
|
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
|
2021-10-08 18:54:42 +02:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Setup DCT
|
|
|
|
if: ${{ env.is_publish_branch == 'true' }}
|
|
|
|
id: setup-dct
|
|
|
|
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
|
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2023-04-13 17:24:09 +02:00
|
|
|
azure-keyvault-name: "bitwarden-ci"
|
2023-02-17 16:36:53 +01:00
|
|
|
|
|
|
|
- name: Build Docker image
|
|
|
|
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5
|
|
|
|
with:
|
|
|
|
context: apps/web
|
|
|
|
file: apps/web/Dockerfile
|
|
|
|
platforms: linux/amd64
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.tag-list.outputs.tags }}
|
|
|
|
secrets: |
|
|
|
|
"GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}"
|
|
|
|
|
|
|
|
- name: Push to DockerHub
|
|
|
|
if: contains(matrix.registries, 'bitwarden') && env.is_publish_branch == 'true'
|
2022-09-29 12:21:47 +02:00
|
|
|
env:
|
2023-02-17 16:36:53 +01:00
|
|
|
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
|
|
|
|
PROJECT_NAME: ${{ matrix.image_name }}
|
|
|
|
DOCKER_CONTENT_TRUST: 1
|
|
|
|
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
|
|
|
|
run: |
|
|
|
|
docker tag bitwardenprod.azurecr.io/$PROJECT_NAME:$IMAGE_TAG bitwarden/$PROJECT_NAME:$IMAGE_TAG
|
|
|
|
docker push bitwarden/$PROJECT_NAME:$IMAGE_TAG
|
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
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
needs:
|
2022-09-19 22:38:19 +02:00
|
|
|
- build-artifacts
|
|
|
|
runs-on: ubuntu-22.04
|
2021-11-04 19:15:29 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 # v2.3.4
|
2021-11-04 19:15:29 +01:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
|
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
|
2022-10-13 21:38:47 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c3b3285993151c5af47cefcb3b9134c28ab479af
|
|
|
|
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
|
2022-06-07 21:31:53 +02:00
|
|
|
uses: crowdin/github-action@ecd7eb0ef6f3cfa16293c79e9cbc4bc5b5fd9c49 # v1.4.9
|
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
|
2021-11-04 19:15:29 +01:00
|
|
|
crowdin_branch_name: master
|
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
|
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:
|
|
|
|
- cloc
|
|
|
|
- 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
|
2021-10-14 20:34:31 +02:00
|
|
|
steps:
|
|
|
|
- name: Check if any job failed
|
2021-10-15 19:06:59 +02:00
|
|
|
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
|
2021-10-14 20:34:31 +02:00
|
|
|
env:
|
|
|
|
CLOC_STATUS: ${{ needs.cloc.result }}
|
|
|
|
SETUP_STATUS: ${{ needs.setup.result }}
|
2022-09-19 22:38:19 +02:00
|
|
|
ARTIFACT_STATUS: ${{ needs.build-artifacts.result }}
|
2022-10-11 16:46:36 +02:00
|
|
|
BUILD_CONTAINERS_STATUS: ${{ needs.build-containers.result }}
|
2021-11-04 19:15:29 +01:00
|
|
|
CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }}
|
2021-10-14 20:34:31 +02:00
|
|
|
run: |
|
|
|
|
if [ "$CLOC_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
|
|
|
elif [ "$SETUP_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
2022-09-19 22:38:19 +02:00
|
|
|
elif [ "$ARTIFACT_STATUS" = "failure" ]; then
|
2021-10-14 20:34:31 +02:00
|
|
|
exit 1
|
2022-09-26 16:16:53 +02:00
|
|
|
elif [ "$BUILD_SELFHOST_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
2022-10-11 16:46:36 +02:00
|
|
|
elif [ "$BUILD_CONTAINERS_STATUS" = "failure" ]; then
|
2021-11-04 19:15:29 +01:00
|
|
|
exit 1
|
|
|
|
elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then
|
2021-10-14 20:34:31 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Login to Azure - Prod Subscription
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: Azure/login@ec3c14589bd3e9312b3cc8c41e6860e258df9010 # v1.1
|
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()
|
2022-10-13 21:38:47 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c3b3285993151c5af47cefcb3b9134c28ab479af
|
|
|
|
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
|
2022-06-03 16:35:46 +02:00
|
|
|
uses: act10ns/slack@da3191ebe2e67f49b46880b4633f5591a96d1d33 # v1.5.1
|
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 }}
|