WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c6e158f

Browse files
authored
Merge pull request #7216 from layer5io/leecalcote/ci/create-lightweight-build
Chore: Implement lightweight build mode for local development
2 parents e920c63 + 9167cc6 commit c6e158f

File tree

11 files changed

+374
-125
lines changed

11 files changed

+374
-125
lines changed

.github/workflows/build-and-deploy-site.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030

3131
- name: Install and Build 🔧
3232
run: |
33-
npm install --legacy-peer-deps
34-
npm run build
33+
make setup
34+
make build
3535
3636
- name: Deploy 🚀
37-
uses: JamesIves/github-pages-deploy-action@4.0.0
37+
uses: JamesIves/github-pages-deploy-action@4.7.4
3838
with:
3939
branch: site # The branch the action should deploy to.
4040
folder: public # The folder the action should deploy.

.github/workflows/build-and-preview-site.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ jobs:
1616

1717
- name: Install and Build 🔧
1818
run: |
19-
npm install --legacy-peer-deps
20-
node -v
21-
npm run version
22-
npm run noIndex
19+
make setup
20+
make site-full
2321
2422
- name: Broken Link Check 🔗
2523
uses: technote-space/broken-link-checker-action@v2

.github/workflows/preview-site.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v2.3.1
14+
uses: actions/checkout@v6
1515

1616
- name: Download Site dir
17-
uses: dawidd6/action-download-artifact@v2
17+
uses: dawidd6/action-download-artifact@v11
1818
with:
1919
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
2020
workflow: build-and-preview-site.yml
@@ -29,7 +29,7 @@ jobs:
2929
3030
- name: Deploy to Netlify
3131
id: netlify
32-
uses: nwtgck/actions-netlify@v1.1
32+
uses: nwtgck/actions-netlify@v3
3333
with:
3434
publish-dir: 'public'
3535
production-deploy: false

Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,29 @@
1414

1515
include .github/build/Makefile.show-help.mk
1616

17-
setup-libs:
18-
## "DEPRECATED: This target is deprecated. Use `make setup`.
19-
2017
## Install layer5.io dependencies your local machine.
2118
setup:
2219
npm install --legacy-peer-deps
2320

24-
## Run layer5.io on your local machine.
21+
# "make site" - The default lightweight build keeps the dev server fast by skipping heavy collections.
22+
## Run a partial build of layer5.io on your local machine.
2523
site:
26-
npm start
27-
24+
@echo "🏗️ Building lightweight site version (excluding Members and Integrations collections)..."
25+
@npm run develop:lite
26+
27+
# "make site-full" forces the dev server to include every collection.
28+
## Run a full build of layer5.io on your local machine.
29+
site-full:
30+
@echo "🏗️ Building full site version (including Members and Integrations collections)..."
31+
@npm run develop
32+
2833
## Run layer5.io on your local machine. Alternate method.
2934
site-fast:
3035
NODE_OPTIONS=--max-old-space-size=8192 gatsby develop
3136

3237
## Build layer5.io on your local machine.
3338
build:
34-
npm run build && npm run serve
39+
npm run build
3540

3641
## Empty build cache and run layer5.io on your local machine.
3742
clean:
@@ -51,4 +56,4 @@ features:
5156
node .github/build/features-to-json.js .github/build/spreadsheet.csv src/sections/Pricing/feature_data.json
5257
rm .github/build/spreadsheet.csv
5358

54-
.PHONY: setup build site clean site-fast lint features
59+
.PHONY: setup build site site-full clean site-fast lint features

gatsby-config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/* eslint-env node */
22

33
const isProduction = process.env.NODE_ENV === "production";
4+
const isFullSiteBuild = process.env.BUILD_FULL_SITE !== "false";
5+
const HEAVY_COLLECTIONS = ["members", "integrations"];
6+
const collectionIgnoreGlobs = isFullSiteBuild
7+
? []
8+
: HEAVY_COLLECTIONS.map((name) => `**/${name}/**`);
49
// const isDevelopment = process.env.NODE_ENV === "development";
510

611
module.exports = {
@@ -449,10 +454,7 @@ module.exports = {
449454
options: {
450455
path: `${__dirname}/src/collections`,
451456
name: "collections",
452-
ignore: [
453-
// eslint-disable-next-line quotes
454-
`src/collections/integrations/**`,
455-
],
457+
ignore: collectionIgnoreGlobs,
456458
},
457459
},
458460
{

0 commit comments

Comments
 (0)