Skip to content

Commit f98d359

Browse files
committed
using encrypted .stage.env
1 parent 417fb0f commit f98d359

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,29 @@ jobs:
2929
with:
3030
creds: ${{ secrets.AZURE_CREDENTIALS }}
3131

32+
- name: Unlock STAGE secrets
33+
uses: sliteteam/[email protected]
34+
env:
35+
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_STAGE }}
36+
37+
- name: Load stage secrets to environment
38+
run: |
39+
set -a
40+
source .stage.env
41+
set +a
42+
3243
- name: Build the docker image
3344
run: |-
3445
docker build \
3546
--target production -t timetracker_ui \
36-
--build-arg API_URL="${{secrets.API_URL_STAGE}}" \
37-
--build-arg AUTHORITY="${{secrets.AUTHORITY}}" \
38-
--build-arg CLIENT_ID="${{secrets.CLIENT_ID_STAGE}}" \
39-
--build-arg CLIENT_URL="${{ secrets.CLIENT_URL_STAGE}}" \
40-
--build-arg SCOPES="${{secrets.SCOPES}}" \
41-
--build-arg AZURE_APP_CONFIGURATION_CONNECTION_STRING="${{secrets.AZURE_APP_CONFIGURATION_CONNECTION_STRING}}" \
47+
--build-arg API_URL="$API_URL" \
48+
--build-arg AUTHORITY="$AUTHORITY" \
49+
--build-arg CLIENT_ID="$CLIENT_ID" \
50+
--build-arg CLIENT_URL="$CLIENT_URL" \
51+
--build-arg SCOPES="$SCOPES" \
52+
--build-arg STACK_EXCHANGE_ID="$STACK_EXCHANGE_ID" \
53+
--build-arg STACK_EXCHANGE_ACCESS_TOKEN="$STACK_EXCHANGE_ACCESS_TOKEN" \
54+
--build-arg AZURE_APP_CONFIGURATION_CONNECTION_STRING="$AZURE_APP_CONFIGURATION_CONNECTION_STRING" \
4255
.
4356
4457
- name: Publish docker image to stage azure container registry

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ RUN useradd -ms /bin/bash ${USERNAME}
3636

3737
COPY nginx.conf /etc/nginx/conf.d/default.conf
3838
COPY --from=building /home/timetracker/time-tracker-ui/dist/time-tracker /usr/share/nginx/html
39-
COPY .env /usr/share/nginx/html
4039
RUN chown -R ${USERNAME}:${USERNAME} /var/cache/nginx && \
4140
chown -R ${USERNAME}:${USERNAME} /var/log/nginx && \
4241
chown -R ${USERNAME}:${USERNAME} /etc/nginx/conf.d

0 commit comments

Comments
 (0)