mirror of
https://github.com/bitwarden/server.git
synced 2025-04-07 05:58:13 -05:00
Update self host release branches (#2438)
* Abstract the publishing branch logic (to make it easier to add/remove custom branches) * Fix the conditional syntax * Another try to fix the conditional syntax * Updating the publish branch logic * Wow...it's been a while since I've written Actions * test the reverse of the publish branch check * Trying again * Another test * Actions uses single quotes... * retest the publish check if the branch actually is correct * Switching to using the ENV instead of outputs * test no publish branch * Switch all of the publish conditionals and remove the testing code * Remove more test code
This commit is contained in:
parent
52144c5bf9
commit
2277625e74
39
.github/workflows/build-self-host.yml
vendored
39
.github/workflows/build-self-host.yml
vendored
@ -18,6 +18,19 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
|
||||||
|
|
||||||
|
- name: Check Branch to Publish
|
||||||
|
env:
|
||||||
|
PUBLISH_BRANCHES: "master,rc,hotfix-rc,rc-2022.12"
|
||||||
|
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
|
||||||
|
|
||||||
########## Set up Docker ##########
|
########## Set up Docker ##########
|
||||||
- name: Set up QEMU emulators
|
- name: Set up QEMU emulators
|
||||||
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
|
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18
|
||||||
@ -35,19 +48,13 @@ jobs:
|
|||||||
run: az acr login -n bitwardenqa
|
run: az acr login -n bitwardenqa
|
||||||
|
|
||||||
- name: Login to Azure - Prod Subscription
|
- name: Login to Azure - Prod Subscription
|
||||||
if: |
|
if: ${{ env.is_publish_branch == 'true' }}
|
||||||
(github.ref == 'refs/heads/master' ||
|
|
||||||
github.ref == 'refs/heads/rc' ||
|
|
||||||
github.ref == 'refs/heads/hotfix-rc')
|
|
||||||
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
|
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||||
|
|
||||||
- name: Retrieve secrets
|
- name: Retrieve secrets
|
||||||
if: |
|
if: ${{ env.is_publish_branch == 'true' }}
|
||||||
(github.ref == 'refs/heads/master' ||
|
|
||||||
github.ref == 'refs/heads/rc' ||
|
|
||||||
github.ref == 'refs/heads/hotfix-rc')
|
|
||||||
id: retrieve-secrets
|
id: retrieve-secrets
|
||||||
uses: bitwarden/gh-actions/get-keyvault-secrets@c3b3285993151c5af47cefcb3b9134c28ab479af
|
uses: bitwarden/gh-actions/get-keyvault-secrets@c3b3285993151c5af47cefcb3b9134c28ab479af
|
||||||
with:
|
with:
|
||||||
@ -58,10 +65,7 @@ jobs:
|
|||||||
dct-delegate-2-key"
|
dct-delegate-2-key"
|
||||||
|
|
||||||
- name: Log into Docker
|
- name: Log into Docker
|
||||||
if: |
|
if: ${{ env.is_publish_branch == 'true' }}
|
||||||
(github.ref == 'refs/heads/master' ||
|
|
||||||
github.ref == 'refs/heads/rc' ||
|
|
||||||
github.ref == 'refs/heads/hotfix-rc')
|
|
||||||
env:
|
env:
|
||||||
DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }}
|
DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }}
|
||||||
DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }}
|
DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }}
|
||||||
@ -69,10 +73,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Docker Trust
|
- name: Setup Docker Trust
|
||||||
if: |
|
if: |
|
||||||
false
|
false &&
|
||||||
&& (github.ref == 'refs/heads/master' ||
|
${{ env.is_publish_branch == 'true' }}
|
||||||
github.ref == 'refs/heads/rc' ||
|
|
||||||
github.ref == 'refs/heads/hotfix-rc')
|
|
||||||
env:
|
env:
|
||||||
DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c"
|
DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c"
|
||||||
DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }}
|
DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }}
|
||||||
@ -118,10 +120,7 @@ jobs:
|
|||||||
tags: ${{ steps.tag-list.outputs.tags }}
|
tags: ${{ steps.tag-list.outputs.tags }}
|
||||||
|
|
||||||
- name: Log out of Docker and disable Docker Notary
|
- name: Log out of Docker and disable Docker Notary
|
||||||
if: |
|
if: ${{ env.is_publish_branch == 'true' }}
|
||||||
(github.ref == 'refs/heads/master' ||
|
|
||||||
github.ref == 'refs/heads/rc' ||
|
|
||||||
github.ref == 'refs/heads/hotfix-rc')
|
|
||||||
run: |
|
run: |
|
||||||
docker logout
|
docker logout
|
||||||
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV
|
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV
|
||||||
|
Loading…
x
Reference in New Issue
Block a user