-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build the app outside of Docker so we can cache the data in CI
Refs: #28
- Loading branch information
Showing
5 changed files
with
4 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
/.dev/ | ||
/.git/ | ||
/.github/ | ||
/dist/ | ||
/node_modules/ | ||
/src/.observablehq/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,10 +55,7 @@ jobs: | |
outputs: type=docker,dest=/tmp/image.tar | ||
cache-from: type=gha,ignore-error=true | ||
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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
FROM node:20.13.1-alpine3.18 AS builder | ||
WORKDIR /app | ||
ENV OBSERVABLE_TELEMETRY_DISABLE=1 | ||
|
||
COPY package.json \ | ||
package-lock.json \ | ||
./ | ||
RUN npm ci --ignore-scripts --production | ||
COPY observablehq.config.js observablehq.config.js | ||
COPY src/ src/ | ||
|
||
FROM builder AS 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 | ||
COPY --from=build /app/dist /usr/share/caddy | ||
COPY dist/ /usr/share/caddy | ||
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.