Skip to content

Commit

Permalink
Add manual workflow to tag latest for web (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimartin12 committed May 5, 2023
1 parent f5c7c9c commit ebbc050
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release-web-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Manual workflow to tag a web version with :latest
---
name: Update Web Latest Tag

on:
workflow_dispatch:

jobs:
get-version:
name: Get Web version
runs-on: ubuntu-22.04
outputs:
_RELEASE_VERSION: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Get version
id: get-version
run: |
VERSION=$(jq -r '.versions.webVersion' < version.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
tag-web-latest:
name: Tag Web version as latest
runs-on: ubuntu-22.04
needs:
- get-version
env:
_RELEASE_VERSION: ${{ needs.get-version.outputs._RELEASE_VERSION }}
steps:
########## DockerHub ##########
- name: Setup DCT
id: setup-dct
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
with:
azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
azure-keyvault-name: "bitwarden-ci"

- name: Pull versioned image
run: docker pull bitwarden/web:$_RELEASE_VERSION

- name: Tag latest
run: docker tag bitwarden/web:$_RELEASE_VERSION bitwarden/web:latest

- name: Push latest image
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
run: docker push bitwarden/web:latest

- name: Log out of Docker and disable Docker Notary
run: |
docker logout
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV

0 comments on commit ebbc050

Please sign in to comment.