Skip to content

Commit

Permalink
fix: Version and hash on docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
nampereira committed Feb 2, 2022
1 parent aaf9fdb commit 31dbf7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
build-args: |
chash=${{ github.sha }}
version=${{ steps.get_release.outputs.tag_name }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/arena-core, ${{ secrets.DOCKER_HUB_USERNAME }}/arena-core:${{ steps.get_release.outputs.tag_name }}

Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# build the js
FROM node:latest
ARG chash
ARG version
RUN mkdir -p /arena-core
WORKDIR /arena-core
WORKDIR /arena-core
COPY ./package.json .
RUN npm install --legacy-peer-deps
COPY . .
RUN echo export const ARENA_VERSION_MSG=\"ARENA commit hash $(git rev-parse --short HEAD)\" > src/arena-version.js
RUN npm install --legacy-peer-deps
COPY . .
RUN echo export const ARENA_VERSION_MSG=\"ARENA $version commit hash $chash\" > src/arena-version.js
RUN mkdir -p dist && npm run build
RUN rm -fr node_modules

Expand Down

0 comments on commit 31dbf7c

Please sign in to comment.