mirror of
https://github.com/bitwarden/web
synced 2025-12-13 06:43:31 +00:00
Add logic for pushing latest image to QA container registry (#1515)
This commit is contained in:
47
.github/workflows/release.yml
vendored
47
.github/workflows/release.yml
vendored
@@ -59,6 +59,7 @@ jobs:
|
|||||||
BRANCH_NAME=$(basename ${{ github.ref }})
|
BRANCH_NAME=$(basename ${{ github.ref }})
|
||||||
echo "::set-output name=branch_name::$BRANCH_NAME"
|
echo "::set-output name=branch_name::$BRANCH_NAME"
|
||||||
|
|
||||||
|
|
||||||
self-host:
|
self-host:
|
||||||
name: Release self-host docker
|
name: Release self-host docker
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
@@ -76,6 +77,10 @@ jobs:
|
|||||||
echo "GitHub event: $GITHUB_EVENT"
|
echo "GitHub event: $GITHUB_EVENT"
|
||||||
echo "Github Release Option: $_RELEASE_OPTION"
|
echo "Github Release Option: $_RELEASE_OPTION"
|
||||||
|
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
||||||
|
|
||||||
|
########## DockerHub ##########
|
||||||
- name: Setup DCT
|
- name: Setup DCT
|
||||||
id: setup-dct
|
id: setup-dct
|
||||||
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
|
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
|
||||||
@@ -83,9 +88,6 @@ jobs:
|
|||||||
azure-creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
azure-creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||||
azure-keyvault-name: "bitwarden-prod-kv"
|
azure-keyvault-name: "bitwarden-prod-kv"
|
||||||
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
|
|
||||||
|
|
||||||
- name: Pull latest selfhost image
|
- name: Pull latest selfhost image
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
|
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
|
||||||
@@ -103,9 +105,6 @@ jobs:
|
|||||||
docker tag bitwarden/web:$_BRANCH_NAME bitwarden/web:latest
|
docker tag bitwarden/web:$_BRANCH_NAME bitwarden/web:latest
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: List Docker images
|
|
||||||
run: docker images
|
|
||||||
|
|
||||||
- name: Push version and latest image
|
- name: Push version and latest image
|
||||||
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
env:
|
env:
|
||||||
@@ -115,9 +114,43 @@ jobs:
|
|||||||
docker push bitwarden/web:$_RELEASE_VERSION
|
docker push bitwarden/web:$_RELEASE_VERSION
|
||||||
docker push bitwarden/web:latest
|
docker push bitwarden/web:latest
|
||||||
|
|
||||||
|
- name: Log out of Docker and disable Docker Notary
|
||||||
|
run: |
|
||||||
|
docker logout
|
||||||
|
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
########## ACR ##########
|
||||||
|
- name: Login to Azure - QA Subscription
|
||||||
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||||
|
with:
|
||||||
|
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
||||||
|
|
||||||
|
- name: Login to Azure ACR
|
||||||
|
run: az acr login -n bitwardenqa
|
||||||
|
|
||||||
|
- name: Tag version and latest
|
||||||
|
env:
|
||||||
|
REGISTRY: bitwardenqa.azurecr.io
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
|
||||||
|
docker tag bitwarden/web:latest $REGISTRY/web:dryrun
|
||||||
|
else
|
||||||
|
docker tag bitwarden/web:$_BRANCH_NAME $REGISTRY/web:$_RELEASE_VERSION
|
||||||
|
docker tag bitwarden/web:$_BRANCH_NAME $REGISTRY/web:latest
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Push version and latest image
|
||||||
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
|
env:
|
||||||
|
REGISTRY: bitwardenqa.azurecr.io
|
||||||
|
run: |
|
||||||
|
docker push $REGISTRY/web:$_RELEASE_VERSION
|
||||||
|
docker push $REGISTRY/web:latest
|
||||||
|
|
||||||
- name: Log out of Docker
|
- name: Log out of Docker
|
||||||
run: docker logout
|
run: docker logout
|
||||||
|
|
||||||
|
|
||||||
ghpages-deploy:
|
ghpages-deploy:
|
||||||
name: Deploy Web Vault
|
name: Deploy Web Vault
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
@@ -182,6 +215,7 @@ jobs:
|
|||||||
--base gh-pages \
|
--base gh-pages \
|
||||||
--head "$PR_BRANCH"
|
--head "$PR_BRANCH"
|
||||||
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Create GitHub Release
|
name: Create GitHub Release
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
@@ -217,6 +251,7 @@ jobs:
|
|||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
|
|
||||||
dry-run:
|
dry-run:
|
||||||
name: Dry Run Cleanup
|
name: Dry Run Cleanup
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|||||||
Reference in New Issue
Block a user