diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index 04972d88d..0a52fcf8e 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -170,6 +170,7 @@ jobs: SENTRY_PROJECT: ${{ env.PROJECT_NAME }} with: environment: ${{ needs.metadata.outputs.stage }} + version: ${{ needs.merge.outputs.sha }} set_commits: skip - name: Finish deployment diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 5be175a75..15ad2c9d3 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -29,6 +29,8 @@ jobs: steps: - name: Get metadata id: get_metadata + env: + INPUT_SHA: ${{ inputs.sha }} run: | if [ $GITHUB_REF_NAME = 'master' ]; then echo '::set-output name=tag::latest' @@ -37,18 +39,12 @@ jobs: fi if [ $GITHUB_REF_NAME = 'staging' ] || [ $GITHUB_REF_NAME = 'master' ]; then - BUILD_ARGS='BUILD_HASH='$GITHUB_SHA + BUILD_ARGS='BUILD_HASH='${INPUT_SHA:-GITHUB_SHA} if [ $GITHUB_REF_NAME = 'staging' ]; then BUILD_ARGS+=$'\nDEPLOY_TARGET=staging' fi BUILD_ARGS=${BUILD_ARGS//$'\n'/'%0A'} echo '::set-output name=build_args::'$BUILD_ARGS - - if [ $GITHUB_REF_NAME = 'master' ]; then - echo '::set-output name=stage::production' - else - echo '::set-output name=stage::staging' - fi fi publish: @@ -99,9 +95,9 @@ jobs: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} SENTRY_PROJECT: ${{ env.PROJECT_NAME }} with: - environment: ${{ needs.metadata.outputs.stage }} finalize: false sourcemaps: sourcemaps + version: ${{ inputs.sha }} url_prefix: ~/assets/ update_check_run: diff --git a/config/environment.js b/config/environment.js index 8c45659a2..161cc7f71 100644 --- a/config/environment.js +++ b/config/environment.js @@ -99,7 +99,7 @@ module.exports = function(environment) { sentry: { dsn: 'https://invalid@sentry.io/12345', // invalid key, will be replaced when run as prod environment: deployTarget, - release: `amber-ui@${process.env.BUILD_HASH}` + release: process.env.BUILD_HASH } };