1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

Update workflows (#1344)

This commit is contained in:
Vince Grassia 2021-12-16 11:46:26 -05:00 committed by GitHub
parent 97ca771a00
commit 6a1e683a93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 36 deletions

View File

@ -40,8 +40,7 @@ jobs:
- name: Get GitHub sha as version
id: version
run: |
echo "::set-output name=value::${GITHUB_SHA:0:7}"
run: echo "::set-output name=value::${GITHUB_SHA:0:7}"
build-oss-selfhost:
@ -170,7 +169,7 @@ jobs:
echo "GitHub event: $GITHUB_EVENT"
- name: Setup DCT
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/release'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix'
id: setup-dct
uses: bitwarden/gh-actions/setup-docker-trust@a8c384a05a974c05c48374c818b004be221d43ff
with:
@ -216,12 +215,12 @@ jobs:
if: github.ref == 'refs/heads/master'
run: docker tag bitwarden/web bitwarden/web:dev
- name: Tag release branch
if: github.ref == 'refs/heads/release'
run: docker tag bitwarden/web bitwarden/web:latest
- name: Tag hotfix branch
if: github.ref == 'refs/heads/hotfix'
run: docker tag bitwarden/web bitwarden/web:hotfix
- name: List Docker images
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/release'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix'
run: docker images
- name: Push rc image
@ -238,15 +237,15 @@ jobs:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
- name: Push latest image
if: github.ref == 'refs/heads/release'
run: docker push bitwarden/web:latest
- name: Push hotfix image
if: github.ref == 'refs/heads/hotfix'
run: docker push bitwarden/web:hotfix
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
- name: Log out of Docker
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/release'
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix'
run: docker logout
@ -310,21 +309,21 @@ jobs:
docker --version
docker build -t bitwardenqa.azurecr.io/web .
- name: Get image tag
id: image-tag
run: |
IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
TAG_EXTENSION=${{ github.event.inputs.custom_tag_extension }}
# - name: Get image tag
# id: image-tag
# run: |
# IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
# TAG_EXTENSION=${{ github.event.inputs.custom_tag_extension }}
if [[ $TAG_EXTENSION ]]; then
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
fi
echo "::set-output name=value::$IMAGE_TAG"
# if [[ $TAG_EXTENSION ]]; then
# IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
# fi
# echo "::set-output name=value::$IMAGE_TAG"
- name: Tag image
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
run: docker tag bitwardenqa.azurecr.io/web "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
# - name: Tag image
# env:
# IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
# run: docker tag bitwardenqa.azurecr.io/web "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
- name: Tag dev
if: github.ref == 'refs/heads/master'
@ -333,10 +332,10 @@ jobs:
- name: List Docker images
run: docker images
- name: Push image
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
run: docker push "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
# - name: Push image
# env:
# IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
# run: docker push "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
- name: Push dev images
if: github.ref == 'refs/heads/master'

View File

@ -54,6 +54,7 @@ jobs:
runs-on: ubuntu-20.04
needs: setup
env:
_BRANCH_NAME: ${{ needs.setup.outputs.branch-name }}
_RELEASE_VERSION: ${{ needs.setup.outputs.release_version }}
steps:
- name: Print environment
@ -73,22 +74,24 @@ jobs:
- name: Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Pull latest selfhost Release image
run: docker pull bitwarden/web:latest
- name: Pull latest selfhost image
run: docker pull bitwarden/web:$_BRANCH_NAME
- name: Tag version
- name: Tag version and latest
run: |
docker tag bitwarden/web:latest bitwarden/web:$_RELEASE_VERSION
docker tag bitwarden/web:$_BRANCH_NAME bitwarden/web:$_RELEASE_VERSION
docker tag bitwarden/web:$_BRANCH_NAME bitwarden/web:latest
- name: List Docker images
run: docker images
- name: Push images
run: |
docker push bitwarden/web:$_RELEASE_VERSION
- name: Push version and 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:$_RELEASE_VERSION
docker push bitwarden/web:latest
- name: Log out of Docker
run: docker logout