-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
146580b
commit 9915d56
Showing
17 changed files
with
11,331 additions
and
241 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build pages | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: Ref name to build | ||
required: true | ||
type: string | ||
sha: | ||
description: SHA, should correspond to ref | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: Ref name to build | ||
required: true | ||
type: string | ||
sha: | ||
description: SHA, should correspond to ref | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: docs-16c-64gb-600gb | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 # fetch whole repo so git-restore-mtime can work | ||
lfs: true | ||
|
||
- name: Adjust file watchers limit | ||
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
cache-dependency-path: "package-lock.json" | ||
env: | ||
NODE_ENV: ${{ secrets.NODE_ENV }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
npm run presetup | ||
npm ci --ignore-scripts | ||
env: | ||
NODE_ENV: ${{ secrets.NODE_ENV }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Run NPM install scripts | ||
run: | | ||
npm rebuild | ||
- name: Checking Gatsby cache | ||
id: gatsby-cache-build | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
public/* | ||
!public/pdfs | ||
.cache | ||
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('package.json', 'gatsby-config.js', 'gatsby-node.js') }}-${{ inputs.ref }}-${{ inputs.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-gatsby-build-${{ hashFiles('package.json', 'gatsby-config.js', 'gatsby-node.js') }}-${{ inputs.ref }} | ||
${{ runner.os }}-gatsby-build-${{ hashFiles('package.json', 'gatsby-config.js', 'gatsby-node.js') }} | ||
${{ runner.os }}-gatsby-build | ||
- name: Fix mtimes | ||
run: npm run fix-mtimes | ||
|
||
- name: Gatsby build | ||
run: npm run build | ||
env: | ||
APP_ENV: staging | ||
NODE_ENV: ${{ vars.NODE_ENV }} | ||
NODE_OPTIONS: --max-old-space-size=4096 | ||
FATHOM_SITE_ID: ${{ vars.FATHOM_SITE_ID }} | ||
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | ||
ALGOLIA_SEARCH_ONLY_KEY: ${{ vars.ALGOLIA_SEARCH_ONLY_KEY }} | ||
ALGOLIA_APP_ID: ${{ vars.ALGOLIA_APP_ID }} | ||
ALGOLIA_INDEX_NAME: edb-docs-staging | ||
INDEX_ON_BUILD: ${{ inputs.ref == 'develop' }} | ||
|
||
- name: Store pages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pages-build | ||
path: | | ||
public/* | ||
!public/pdfs |
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Generate PDFs | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: Ref name to build | ||
required: true | ||
type: string | ||
sha: | ||
description: SHA, should correspond to ref | ||
required: true | ||
type: string | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: Ref name to build | ||
required: true | ||
type: string | ||
sha: | ||
description: SHA, should correspond to ref | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build: | ||
runs-on: docs-16c-64gb-600gb | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
lfs: true | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
cache-dependency-path: "package-lock.json" | ||
env: | ||
NODE_ENV: ${{ vars.NODE_ENV }} | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11.6" | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
with: | ||
pandoc-version: "2.14.1" | ||
|
||
- name: Install wkhtmltopdf | ||
run: | | ||
curl -L https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb > wkhtmltopdf.deb | ||
sudo apt update | ||
sudo apt install -y ./wkhtmltopdf.deb | ||
sudo apt install -y rsync | ||
- name: Install Python dependencies | ||
run: pip install -r requirements-ci.txt | ||
|
||
- name: Install PDF Node dependencies | ||
working-directory: ./scripts/pdf | ||
run: | | ||
npm install | ||
- name: Checking PDF cache | ||
id: pdf-cache-build | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
product_docs/**/*.pdf | ||
product_docs/**/*.pdf-hash | ||
advocacy_docs/**/*.pdf | ||
advocacy_docs/**/*.pdf-hash | ||
key: ${{ runner.os }}-build-pdfs-${{ hashFiles('scripts/pdf/*', 'scripts/pdf/lib/*') }}-${{ inputs.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-build-pdfs-${{ hashFiles('scripts/pdf/*', 'scripts/pdf/lib/*') }} | ||
- name: Build all pdfs | ||
run: npm run pdf:build-all-ci | ||
|
||
- name: Copy pdfs to build output | ||
run: | | ||
mkdir -p public/pdfs | ||
shopt -s globstar | ||
rsync -avm --filter="+ */" --filter="-! *.pdf" advocacy_docs/ public/pdfs/ | ||
rsync -avm --filter="+ */" --filter="-! *.pdf" product_docs/docs/ public/pdfs/ | ||
- name: Store pdfs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pdf-build | ||
path: public/* |
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deploy build to Netlify | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
inputs: | ||
enable-pull-request-comment: | ||
description: whether to comment on the triggering PR | ||
required: false | ||
default: true | ||
type: boolean | ||
enable-commit-comment: | ||
description: whether to comment on the triggering commit | ||
required: false | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Pull build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./public | ||
merge-multiple: true | ||
|
||
- name: list | ||
run: ls -lfR ./public | ||
|
||
- name: Deploy to Netlify | ||
id: netlify-deploy | ||
if: false | ||
uses: nwtgck/actions-netlify@v3 | ||
with: | ||
publish-dir: "./public" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
enable-pull-request-comment: ${{ inputs.enable-pull-request-comment }} | ||
enable-commit-comment: ${{ inputs.enable-commit-comment }} | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEVELOP_SITE_ID }} |
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
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 +1 @@ | ||
18 | ||
22 |
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
Oops, something went wrong.