Skip to content

Commit 46e19de

Browse files
authored
[DEVOPS-1566] - add DCT test workflow (#158)
* add DCT test workflow * Fix typo * Add suggestion * update the test to only reference mssql utility * UPDATE: project name to repo var
1 parent 0ba963b commit 46e19de

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/DCT-test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Test DCT
3+
4+
on:
5+
workflow_dispatch: {}
6+
7+
env:
8+
_AZ_REGISTRY: bitwardenprod.azurecr.io
9+
10+
jobs:
11+
test-dct:
12+
name: Pull and push images to DH to test DCT
13+
runs-on: ubuntu-22.04
14+
env:
15+
_REPO: mssqlmigratorutility
16+
_IMAGE_TAG: latest
17+
steps:
18+
19+
- name: Login to Azure - Prod Subscription
20+
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
21+
with:
22+
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
23+
24+
- name: Login to Azure ACR
25+
run: az acr login -n ${_AZ_REGISTRY%.azurecr.io}
26+
27+
########## DockerHub ##########
28+
- name: Setup DCT
29+
id: setup-dct
30+
uses: bitwarden/gh-actions/setup-docker-trust@082f5e05ed97c3601c6f3179250b1a761c4d647f
31+
with:
32+
azure-creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
33+
azure-keyvault-name: "bitwarden-ci"
34+
35+
- name: Pull and tag image from ACR
36+
run: |
37+
docker pull $_AZ_REGISTRY/$_REPO:$_IMAGE_TAG
38+
docker tag $_AZ_REGISTRY/$_REPO:$_IMAGE_TAG bitwarden/$_REPO:$_IMAGE_TAG
39+
40+
- name: Push image to Docker Hub
41+
env:
42+
DOCKER_CONTENT_TRUST: 1
43+
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }}
44+
run: docker push bitwarden/$_REPO:$_IMAGE_TAG
45+
46+
- name: Log out of Docker and disable Docker Notary
47+
run: |
48+
docker logout
49+
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV

0 commit comments

Comments
 (0)