Skip to content

Commit bb9d7a5

Browse files
Inject from secrets
1 parent f74cb3f commit bb9d7a5

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/push-landing-page-ghcr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040

4141
- name: Build and push image
4242
uses: docker/build-push-action@v7
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GHP_TOKEN }}
4543
with:
4644
context: ./apps/landing-page
4745
file: ./apps/landing-page/Dockerfile
4846
push: true
47+
secrets: |
48+
github_token=${{ secrets.GHP_TOKEN }}
4949
tags: |
5050
ghcr.io/${{ github.repository }}-landing-page:latest
5151
ghcr.io/${{ github.repository }}-landing-page:${{ github.sha }}

apps/landing-page/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ COPY . .
2727
# Uncomment the following line in case you want to disable telemetry during the build.
2828
ENV NEXT_TELEMETRY_DISABLED=1
2929

30-
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
31-
32-
RUN \
30+
RUN --mount=type=secret,id=github_token \
31+
export GITHUB_TOKEN=$(cat /run/secrets/github_token) && \
3332
if [ -f yarn.lock ]; then yarn run build; \
3433
elif [ -f package-lock.json ]; then npm run build; \
3534
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \

0 commit comments

Comments
 (0)