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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.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"
|
2023-06-01 08:49:25 +02:00
|
|
|
- name: "eudevtest"
|
|
|
|
npm_command: "build:bit:eudevtest"
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2020-12-21 18:46:36 +01:00
|
|
|
- name: Set up Node
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-03-17 14:02:50 +01:00
|
|
|
|
2023-02-17 16:36:53 +01:00
|
|
|
- name: Check Branch to Publish
|
|
|
|
env:
|
2023-05-10 16:56:40 +02:00
|
|
|
PUBLISH_BRANCHES: "master,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 ##########
|
|
|
|
- name: Login to Azure - QA
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
2023-02-17 16:36:53 +01:00
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Log into QA container registry
|
|
|
|
run: az acr login -n bitwardenqa
|
|
|
|
|
|
|
|
- name: Login to Azure - Prod
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
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
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
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
|
|
|
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
2023-04-11 18:37:58 +02:00
|
|
|
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
|
2023-05-24 15:33:02 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c86ced0dc8c9daeecf057a6333e6f318db9c5a2b
|
2023-02-17 16:36:53 +01:00
|
|
|
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
|
2023-05-24 15:33:02 +02:00
|
|
|
uses: bitwarden/gh-actions/setup-docker-trust@c86ced0dc8c9daeecf057a6333e6f318db9c5a2b
|
2023-02-17 16:36:53 +01:00
|
|
|
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
|
2023-05-09 11:44:05 +02:00
|
|
|
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
|
2023-02-17 16:36:53 +01:00
|
|
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2021-11-04 19:15:29 +01:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
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-05-24 15:33:02 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c86ced0dc8c9daeecf057a6333e6f318db9c5a2b
|
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
|
2023-05-22 21:13:42 +02:00
|
|
|
uses: crowdin/github-action@102b5aa21783a64027193ef802a616140a1ca102 # v1.8.1
|
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
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
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-05-24 15:33:02 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c86ced0dc8c9daeecf057a6333e6f318db9c5a2b
|
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 }}
|