Skip to content

Commit

Permalink
Feature: added export script for Strapi Export
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmylevell committed Jul 26, 2024
1 parent a74c634 commit 1c377ca
Show file tree
Hide file tree
Showing 5 changed files with 874 additions and 663 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm run build

# Create backend export
- run: node scripts/strapiToJson.py
- run: mv exports build/export

- uses: actions/upload-artifact@v4
with:
name: build-cache-gp
Expand Down Expand Up @@ -97,10 +102,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm run build
- run: echo "$(envsubst < build/index.html)" > build/index.html

# Create backend export
- run: node scripts/strapiToJson.py
- run: mv exports build/export

- uses: actions/upload-artifact@v4
with:
name: build-cache-prod
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ yarn-error.log*
Digital-Export

.env

# Strapi Exports
exports
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ ENV REACT_APP_PUBLIC_URL=/
RUN sed -i "s|base: '/thilo/',|base: '/',|g" vite.config.ts
RUN npm install
RUN export NODE_OPTIONS=--openssl-legacy-provider && npm run build

# Create backend export
RUN node src/scripts/strapiToJson.js
RUN mv exports build/exports

RUN chmod +x entrypoint.sh
RUN dos2unix entrypoint.sh

Expand Down
Loading

0 comments on commit 1c377ca

Please sign in to comment.