mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
Update Unified Self-Host Build Workflow (#2432)
This commit is contained in:
parent
41ee3d4c69
commit
0795545fb8
36
.github/workflows/build-self-host.yml
vendored
36
.github/workflows/build-self-host.yml
vendored
@ -56,14 +56,19 @@ jobs:
|
||||
push: true
|
||||
tags: bitwardenqa.azurecr.io/self-host:${{ steps.tag.outputs.image_tag }}
|
||||
|
||||
- name: Pull new image
|
||||
env:
|
||||
PROJECT_NAME: self-host
|
||||
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
|
||||
run: docker pull bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG}
|
||||
|
||||
- name: Log out of Docker
|
||||
run: docker logout
|
||||
|
||||
########## DockerHub ##########
|
||||
- name: Login to Azure - Prod Subscription
|
||||
if: |
|
||||
false
|
||||
&& (github.ref == 'refs/heads/master' ||
|
||||
(github.ref == 'refs/heads/master' ||
|
||||
github.ref == 'refs/heads/rc' ||
|
||||
github.ref == 'refs/heads/hotfix-rc')
|
||||
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
|
||||
@ -72,8 +77,7 @@ jobs:
|
||||
|
||||
- name: Retrieve secrets
|
||||
if: |
|
||||
false
|
||||
&& (github.ref == 'refs/heads/master' ||
|
||||
(github.ref == 'refs/heads/master' ||
|
||||
github.ref == 'refs/heads/rc' ||
|
||||
github.ref == 'refs/heads/hotfix-rc')
|
||||
id: retrieve-secrets
|
||||
@ -87,8 +91,7 @@ jobs:
|
||||
|
||||
- name: Log into Docker
|
||||
if: |
|
||||
false
|
||||
&& (github.ref == 'refs/heads/master' ||
|
||||
(github.ref == 'refs/heads/master' ||
|
||||
github.ref == 'refs/heads/rc' ||
|
||||
github.ref == 'refs/heads/hotfix-rc')
|
||||
env:
|
||||
@ -112,29 +115,22 @@ jobs:
|
||||
echo "DOCKER_CONTENT_TRUST=1" >> $GITHUB_ENV
|
||||
echo "DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$DCT_REPO_PASSPHRASE" >> $GITHUB_ENV
|
||||
|
||||
- name: Tag and Push RC to Docker Hub
|
||||
- name: Tag and Push image to Docker Hub
|
||||
if: |
|
||||
false
|
||||
&& (github.ref == 'refs/heads/master' ||
|
||||
(github.ref == 'refs/heads/master' ||
|
||||
github.ref == 'refs/heads/rc' ||
|
||||
github.ref == 'refs/heads/hotfix-rc')
|
||||
env:
|
||||
PROJECT_NAME: self-host
|
||||
REGISTRY: bitwarden
|
||||
IMAGE_TAG: ${{ steps.tag.outputs.image_tag }}
|
||||
run: |
|
||||
IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name
|
||||
if [[ "$IMAGE_TAG" == "master" ]]; then
|
||||
IMAGE_TAG=dev
|
||||
fi
|
||||
|
||||
docker tag $PROJECT_NAME \
|
||||
$REGISTRY/$PROJECT_NAME:$IMAGE_TAG
|
||||
docker push $REGISTRY/$PROJECT_NAME:$IMAGE_TAG
|
||||
docker tag bitwardenqa.azurecr.io/${PROJECT_NAME}:${IMAGE_TAG} \
|
||||
bitwarden/${PROJECT_NAME}:${IMAGE_TAG}
|
||||
docker push bitwarden/${PROJECT_NAME}:${IMAGE_TAG}
|
||||
|
||||
- name: Log out of Docker and disable Docker Notary
|
||||
if: |
|
||||
false
|
||||
&& (github.ref == 'refs/heads/master' ||
|
||||
(github.ref == 'refs/heads/master' ||
|
||||
github.ref == 'refs/heads/rc' ||
|
||||
github.ref == 'refs/heads/hotfix-rc')
|
||||
run: |
|
||||
|
Loading…
Reference in New Issue
Block a user