Skip to content
This repository has been archived by the owner on Jan 11, 2025. It is now read-only.

Commit

Permalink
Pass GITHUB_SHA as build arg
Browse files Browse the repository at this point in the history
  • Loading branch information
torbencarstens committed Jun 8, 2022
1 parent ac44b15 commit 7dd1fa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the tagged Docker image
run: docker build -e GITHUB_SHA=$GITHUB_SHA -t ghcr.io/tim-hat-die-hand-an-der-maus/preliminary-frontend:${GITHUB_SHA} .
run: docker build --build-arg GITHUBSHA=${GITHUB_SHA} -t ghcr.io/tim-hat-die-hand-an-der-maus/preliminary-frontend:${GITHUB_SHA} .
- name: Push the tagged Docker image
run: docker push ghcr.io/tim-hat-die-hand-an-der-maus/preliminary-frontend:${GITHUB_SHA}

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:17-alpine3.15 as builder

ARG GITHUBSHA

WORKDIR /usr/src/app

COPY babel.config.js .
Expand All @@ -8,7 +10,7 @@ COPY yarn.lock .
COPY src/ src/
COPY public/ public/

RUN sed -i -e "s#__commit_sha__#$(echo ${GITHUB_SHA})#g" src/App.vue
RUN sed -i -e "s#__commit_sha__#$GITHUBSHA#g" src/App.vue

RUN yarn install
RUN yarn build
Expand Down

0 comments on commit 7dd1fa3

Please sign in to comment.