mirror of
https://github.com/bitwarden/server.git
synced 2025-02-22 02:51:33 +01:00
[DEVOPS-1657] - UPDATE: Adds k8s deploy trigger on main branch (#3597)
This commit is contained in:
parent
1b379485a5
commit
3f1f6b576a
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
@ -525,8 +525,7 @@ jobs:
|
||||
self-host-build:
|
||||
name: Trigger self-host build
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- build-docker
|
||||
needs: build-docker
|
||||
steps:
|
||||
- name: Login to Azure - CI Subscription
|
||||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
||||
@ -555,6 +554,40 @@ jobs:
|
||||
}
|
||||
})
|
||||
|
||||
trigger-k8s-deploy:
|
||||
name: Trigger k8s deploy
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build-docker
|
||||
steps:
|
||||
- name: Login to Azure - CI Subscription
|
||||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
|
||||
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 k8s deploy
|
||||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
|
||||
with:
|
||||
github-token: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
|
||||
script: |
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: 'bitwarden',
|
||||
repo: 'devops',
|
||||
workflow_id: 'deploy-k8s.yml',
|
||||
ref: 'main',
|
||||
inputs: {
|
||||
environment: 'US-DEV Cloud',
|
||||
tag: 'main'
|
||||
}
|
||||
})
|
||||
|
||||
check-failures:
|
||||
name: Check for failures
|
||||
if: always()
|
||||
@ -568,6 +601,7 @@ jobs:
|
||||
- upload
|
||||
- build-mssqlmigratorutility
|
||||
- self-host-build
|
||||
- trigger-k8s-deploy
|
||||
steps:
|
||||
- name: Check if any job failed
|
||||
if: |
|
||||
@ -583,6 +617,7 @@ jobs:
|
||||
UPLOAD_STATUS: ${{ needs.upload.result }}
|
||||
BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }}
|
||||
TRIGGER_SELF_HOST_BUILD_STATUS: ${{ needs.self-host-build.result }}
|
||||
TRIGGER_K8S_DEPLOY_STATUS: ${{ needs.trigger-k8s-deploy.result }}
|
||||
run: |
|
||||
if [ "$CLOC_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
@ -600,6 +635,8 @@ jobs:
|
||||
exit 1
|
||||
elif [ "$TRIGGER_SELF_HOST_BUILD_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$TRIGGER_K8S_DEPLOY_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Login to Azure - CI subscription
|
||||
|
Loading…
Reference in New Issue
Block a user