Skip to content

Commit

Permalink
Make the API key for fetching review data available to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Jul 1, 2024
1 parent 4670b19 commit fbf10c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PREREVIEW_REVIEWS_DATA_TOKEN=token-here
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
cache-to: type=gha,mode=max,ignore-error=true
no-cache-filters: build
target: prod
secrets: |
PREREVIEW_REVIEWS_DATA_TOKEN=${{ secrets.PREREVIEW_REVIEWS_DATA_TOKEN }}
- name: 'Upload build'
uses: actions/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ COPY observablehq.config.js observablehq.config.js
COPY src/ src/

FROM builder AS build
RUN npx observable build
RUN --mount=type=secret,id=PREREVIEW_REVIEWS_DATA_TOKEN \
PREREVIEW_REVIEWS_DATA_TOKEN=$(cat /run/secrets/PREREVIEW_REVIEWS_DATA_TOKEN) \
npx observable build

FROM caddy:2.8.4-alpine AS prod
COPY Caddyfile /etc/caddy/Caddyfile
Expand Down

0 comments on commit fbf10c3

Please sign in to comment.