Skip to content

Commit 38b3cd8

Browse files
committed
using docker buildkit
1 parent eaa95fe commit 38b3cd8

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

.github/workflows/time-tracker-ui-cd-stage.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v3
2121

22+
- name: Set up Docker Buildx
23+
id: buildx
24+
uses: docker/setup-buildx-action@v2
25+
2226
- name: Get the release_version
2327
run: |
2428
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
@@ -41,15 +45,8 @@ jobs:
4145
- name: Build the docker image
4246
run: |-
4347
docker build \
44-
--target production -t timetracker_ui \
45-
--build-arg API_URL="::add-mask::${{ env.API_URL }}" \
46-
--build-arg AUTHORITY="$AUTHORITY" \
47-
--build-arg CLIENT_ID="$CLIENT_ID" \
48-
--build-arg CLIENT_URL="$CLIENT_URL" \
49-
--build-arg SCOPES=${{ env.SCOPES }}" \
50-
--build-arg STACK_EXCHANGE_ID="$STACK_EXCHANGE_ID" \
51-
--build-arg STACK_EXCHANGE_ACCESS_TOKEN="$STACK_EXCHANGE_ACCESS_TOKEN" \
52-
--build-arg AZURE_APP_CONFIGURATION_CONNECTION_STRING="$AZURE_APP_CONFIGURATION_CONNECTION_STRING" \
48+
--secret id=mysecret,src=.stage.env \
49+
--target production -t timetracker_ui \
5350
.
5451
5552
- name: Publish docker image to stage azure container registry

Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# syntax=docker/dockerfile:1.2
2+
13
FROM node:14 AS building
24

35
ENV USERNAME timetracker
@@ -18,15 +20,7 @@ ARG CLIENT_ID
1820
ARG CLIENT_URL
1921
ARG SCOPES
2022
ARG AZURE_APP_CONFIGURATION_CONNECTION_STRING
21-
22-
RUN API_URL=${API_URL} \
23-
AUTHORITY=${AUTHORITY} \
24-
CLIENT_ID=${CLIENT_ID} \
25-
CLIENT_URL=${CLIENT_URL} \
26-
SCOPES=${SCOPES} \
27-
AZURE_APP_CONFIGURATION_CONNECTION_STRING=${AZURE_APP_CONFIGURATION_CONNECTION_STRING}
28-
29-
RUN npm run build
23+
RUN --mount=type=secret,id=mysecret set -a && source /run/secrets/mysecret && set +a && npm run build
3024

3125

3226
FROM nginx:1.21 AS production

0 commit comments

Comments
 (0)