1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-12 10:14:10 +01:00
bitwarden-browser/.github/workflows/qa-deploy.yml
Joseph Flinn ab0ce71db8
Updating to new CI model (#1196)
* starting the new pipeline model update

* updating the deploy portion of the pipeline

* adding a stub for the release notes

* removing the redundant deploy workflow

* fixing the cloud job. Adding a npm pre-cache

* updating the hashFile for the caches

* removing the cache-hit check since the logic doesn't work for node_modules

* checking out the repo in the precache

* removing the pre-cache step. Seems to slow down the pipeline overall

* ghpage-deploy with the correct input for the versions

* testing a custom action for the DCT setup

* fixing a typo

* fixing the shell issue in the custom action

* removing a conditional to run a test

* testing redaction

* fixing the weird colon inline with run issue

* commenting out the DCT for testing

* test passed. Updating the release pipeline with the new Setup DCT action

* updating the DCT setup action hash

* updating the release workflow with the linter suggestions
2021-09-21 09:37:17 -07:00

73 lines
2.2 KiB
YAML

---
name: QA Deploy
on:
workflow_dispatch:
inputs:
image_extension:
description: "Image tag extension"
required: false
env:
_QA_CLUSTER_RESOURCE_GROUP: "bitwarden-devops"
_QA_CLUSTER_NAME: "dev-aks"
_QA_K8S_NAMESPACE: "bw-qa"
_QA_K8S_APP_NAME: "bw-web"
jobs:
deploy:
name: Deploy QA Web
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Setup
run:
export PATH=$PATH:~/work/web/web
- name: Login to Azure
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
with:
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
- name: Retrieve secrets
id: retrieve-secrets
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
with:
keyvault: "bitwarden-qa-kv"
secrets: "dev-aks-kubectl-credentials"
- name: Login to dev-aks-kubectl SP
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
with:
creds: ${{ env.dev-aks-kubectl-credentials }}
- name: Setup AKS access
env:
USER_ID: ${{ env.qa-kubectl-managed-identity-clientId }}
run: |
echo "---az install---"
az aks install-cli --install-location ./kubectl --kubelogin-install-location ./kubelogin
echo "---az get-creds---"
az aks get-credentials -n $_QA_CLUSTER_NAME -g $_QA_CLUSTER_RESOURCE_GROUP
- name: Get image tag
id: image_tag
run: |
IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
TAG_EXTENSION=${{ github.events.inputs.image_extension }}
if [[ $TAG_EXTENSION ]]; then
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
fi
echo "::set-output name=value::$IMAGE_TAG"
- name: Deploy Web image
env:
IMAGE_TAG: ${{ steps.image_tag.outputs.value }}
run: |
kubectl set image -n $_QA_K8S_NAMESPACE deployment/web web=bitwardenqa.azurecr.io/web:$IMAGE_TAG --record
kubectl rollout restart -n $_QA_K8S_NAMESPACE deployment/web
kubectl rollout status deployment/web -n $_QA_K8S_NAMESPACE