DEVOPS-1683 REFACTOR: branch/tag references in deploy workflow

This commit is contained in:
Alex Urbina 2023-12-18 15:45:14 -06:00
parent ef090622bc
commit 9e65c510ec
No known key found for this signature in database
GPG Key ID: BFAFE8D81FF8B38D
1 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@ on:
- EUQA
- USPROD
- EUPROD
branch:
branch-or-tag:
description: "Branch name to deploy (examples: 'main', 'feature/sm')"
type: string
default: main
@ -25,7 +25,7 @@ on:
description: 'Environment'
default: 'USQA'
type: string
branch:
branch-or-tag:
description: "Branch name to deploy (examples: 'main', 'feature/sm')"
type: string
default: main
@ -103,7 +103,7 @@ jobs:
with:
project: Clients
environment: ${{ needs.setup.outputs.environment-name }}
tag: ${{ inputs.branch }}
tag: ${{ inputs.branch-or-tag }}
slack-channel: team-eng-qa-devops
event: 'start'
url: https://github.com/bitwarden/clients/actions/runs/${{ github.run_id }}
@ -116,7 +116,7 @@ jobs:
env:
_ENVIRONMENT_ARTIFACT: ${{ needs.setup.outputs.environment-artifact }}
steps:
- name: Download latest cloud asset from branch ${{ inputs.branch }}'
- name: 'Download latest cloud asset from branch/tag: ${{ inputs.branch-or-tag }}'
uses: bitwarden/gh-actions/download-artifacts@main
id: download-artifacts
continue-on-error: true
@ -124,7 +124,7 @@ jobs:
workflow: build-web.yml
path: apps/web
workflow_conclusion: success
branch: ${{ inputs.branch }}
branch: ${{ inputs.branch-or-tag }}
artifacts: ${{ env._ENVIRONMENT_ARTIFACT }}
- name: Login to Azure
@ -141,7 +141,7 @@ jobs:
keyvault: "bitwarden-ci"
secrets: "github-pat-bitwarden-devops-bot-repo-scope"
- name: Trigger build web for missing branch ${{ inputs.branch }}'
- name: 'Trigger build web for missing branch/tag ${{ inputs.branch-or-tag }}'
if: ${{ steps.download-artifacts.outcome == 'failure' }}
uses: convictional/trigger-workflow-and-wait@f69fa9eedd3c62a599220f4d5745230e237904be # v1.6.5
with:
@ -149,7 +149,7 @@ jobs:
repo: clients
github_token: ${{ steps.retrieve-secret.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
workflow_file_name: build-web.yml
ref: ${{ inputs.branch }}
ref: ${{ inputs.branch-or-tag }}
wait_interval: 100
azure-deploy:
@ -175,7 +175,7 @@ jobs:
environment-url: ${{ env._ENVIRONMENT_URL }}
environment: ${{ env._ENVIRONMENT_NAME }}
task: 'deploy'
description: 'Deployment from branch ${{ inputs.branch }}'
description: 'Deployment from branch/tag: ${{ inputs.branch-or-tag }}'
- name: Login to Azure
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
@ -189,13 +189,13 @@ jobs:
keyvault: ${{ needs.setup.outputs.retrieve-secrets-keyvault }}
secrets: "sa-bitwarden-web-vault-dev-key-temp"
- name: Download latest cloud asset
- name: 'Download cloud asset from branch/tag: ${{ inputs.branch-or-tag }}'
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-web.yml
path: apps/web
workflow_conclusion: success
branch: ${{ inputs.branch }}
branch: ${{ inputs.branch-or-tag }}
artifacts: ${{ env._ENVIRONMENT_ARTIFACT }}
- name: Unzip build asset
@ -249,7 +249,7 @@ jobs:
with:
project: Clients
environment: ${{ needs.setup.outputs.environment-name }}
tag: ${{ inputs.branch }}
tag: ${{ inputs.branch-or-tag }}
slack-channel: team-eng-qa-devops
event: ${{ needs.azure-deploy.result }}
url: https://github.com/bitwarden/clients/actions/runs/${{ github.run_id }}