Skip to content

Commit

Permalink
ci: cache assets
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed Jun 5, 2024
1 parent f4f7dde commit ecf824a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ playwright.config.ts

# misc
.editorconfig

# astro assets cache
!/node_modules/.astro/
7 changes: 7 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Cache astro build artefacts
uses: actions/cache@v4
with:
path: node_modules/.astro/
key: ${{ runner.os }}-astro-20.x-${{ github.run_id }}
restore-keys: ${{ runner.os }}-astro-20.x

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Cache astro build artefacts
uses: actions/cache@v4
with:
path: node_modules/.astro/
key: ${{ runner.os }}-astro-${{ matrix.node-version }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-astro-${{ matrix.node-version }}

- name: Install dependencies
run: pnpm install --frozen-lockfile

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ RUN pnpm fetch --dev
COPY --chown=node:node ./ ./
RUN sed -i "s/use-node-version/# use-node-version/" .npmrc

# astro assets cache
COPY --chown=node:node ./node_modules/.astro ./node_modules/.astro

ARG PUBLIC_APP_BASE_PATH
ARG PUBLIC_APP_BASE_URL
ARG PUBLIC_BOTS
Expand Down

0 comments on commit ecf824a

Please sign in to comment.