Commit 59d192ae authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #833 from blockscout/nz-git-sha-fix

Fixing GIT_COMMIT_SHA in docker image
parents b4ac05b1 681bd097
...@@ -65,8 +65,8 @@ jobs: ...@@ -65,8 +65,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
GIT_COMMIT_SHA=${{ env.GITHUB_SHA_SHORT }} GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
GIT_TAG=${{ github.ref_type == 'tag' && github.github.ref_name || '' }}
deploy_and_tests: deploy_and_tests:
# if: github.event.review.state == 'approved' # if: github.event.review.state == 'approved'
needs: push_to_registry needs: push_to_registry
......
...@@ -40,7 +40,7 @@ jobs: ...@@ -40,7 +40,7 @@ jobs:
- name: Add outputs - name: Add outputs
run: | run: |
echo "::set-output name=short-sha::${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" echo "::set-output name=short-sha::${{ env.SHORT_SHA }}"
id: output-step id: output-step
- name: Build and push - name: Build and push
...@@ -53,7 +53,7 @@ jobs: ...@@ -53,7 +53,7 @@ jobs:
tags: ghcr.io/blockscout/frontend:prerelease-${{ env.GITHUB_REF_NAME_SLUG }} tags: ghcr.io/blockscout/frontend:prerelease-${{ env.GITHUB_REF_NAME_SLUG }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
GIT_COMMIT_SHA=${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }} GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
deploy_review_l2: deploy_review_l2:
name: Deploy review l2 name: Deploy review l2
......
...@@ -40,7 +40,7 @@ jobs: ...@@ -40,7 +40,7 @@ jobs:
- name: Add outputs - name: Add outputs
run: | run: |
echo "::set-output name=short-sha::${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }}" echo "::set-output name=short-sha::${{ env.SHORT_SHA }}"
id: output-step id: output-step
- name: Build and push - name: Build and push
...@@ -53,7 +53,7 @@ jobs: ...@@ -53,7 +53,7 @@ jobs:
tags: ghcr.io/blockscout/frontend:prerelease-${{ env.GITHUB_REF_NAME_SLUG }} tags: ghcr.io/blockscout/frontend:prerelease-${{ env.GITHUB_REF_NAME_SLUG }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
GIT_COMMIT_SHA=${{ env.GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT }} GIT_COMMIT_SHA=${{ env.SHORT_SHA }}
deploy_review: deploy_review:
name: Deploy review name: Deploy review
......
...@@ -26,16 +26,18 @@ ARG NEXT_PUBLIC_SENTRY_DSN ...@@ -26,16 +26,18 @@ ARG NEXT_PUBLIC_SENTRY_DSN
ARG SENTRY_CSP_REPORT_URI ARG SENTRY_CSP_REPORT_URI
ARG SENTRY_AUTH_TOKEN ARG SENTRY_AUTH_TOKEN
# pass commit sha to the app (uses by sentry.io as release version)
ARG GIT_COMMIT_SHA
ENV NEXT_PUBLIC_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
RUN yarn build RUN yarn build
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM node:18-alpine AS runner FROM node:18-alpine AS runner
WORKDIR /app WORKDIR /app
# pass commit sha to the app (uses by sentry.io as release version)
ARG GIT_COMMIT_SHA
ENV NEXT_PUBLIC_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
ARG GIT_TAG
ENV NEXT_PUBLIC_GIT_TAG=$GIT_TAG
ENV NODE_ENV production ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime. # Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1 # ENV NEXT_TELEMETRY_DISABLED 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment