From da9d460f6fbcdfe273d5c51059827119c678c04c Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 12 Sep 2023 11:34:28 -0700 Subject: [PATCH] ci: add release tag to docker image --- .github/workflows/release.yml | 9 +++++++++ releaserc.json | 35 +++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46c662081..2e0cf48c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,11 +30,20 @@ jobs: - run: npm ci - run: npm run build-ext --if-present - run: rsync -a package.json README.md ./dist/ + - name: Docker Login + uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 + with: + registry: vprodemo.azurecr.io + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + logout: true - name: Semantic Release uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 with: semantic_version: 19.0.5 # It is recommended to specify a version range # for semantic-release when using # semantic-release-action lower than @v3 + extra_plugins: | + @semantic-release/exec@6.0.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/releaserc.json b/releaserc.json index b3191ae2c..b4c991b39 100644 --- a/releaserc.json +++ b/releaserc.json @@ -1,17 +1,24 @@ { - "branches": [ - "main", - "next" + "branches": [ + "main", + "next" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + [ + "@semantic-release/npm", + { + "npmPublish": false + } ], - "plugins": [ - "@semantic-release/commit-analyzer", - [ - "@semantic-release/npm", - { - "npmPublish": false - } - ], - "@semantic-release/release-notes-generator", - "@semantic-release/github" + "@semantic-release/release-notes-generator", + "@semantic-release/github", + [ + "@semantic-release/exec", + { + "prepareCmd": "docker build -t vprodemo.azurecr.io/rpc-go:v${nextRelease.version} .", + "publishCmd": "docker push vprodemo.azurecr.io/rpc-go:v${nextRelease.version}" + } ] - } \ No newline at end of file + ] +} \ No newline at end of file