Merge pull request #6036 from EnterpriseDB/release-2024-09-09a #680
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
name: Deploy Main to Netlify | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-deploy: | |
runs-on: docs-16c-64gb-600gb | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
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: ${{ vars.NODE_ENV }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Install dependencies | |
run: | | |
npm run presetup | |
npm ci --ignore-scripts | |
env: | |
NODE_ENV: ${{ vars.NODE_ENV }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Run NPM install scripts | |
run: | | |
npm rebuild | |
- 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/wkhtmltox_0.12.6-1.focal_amd64.deb > wkhtmltopdf.deb | |
sudo apt-get install ./wkhtmltopdf.deb | |
- name: Install Python dependencies | |
run: pip install -r requirements-ci.txt | |
- name: Install PDF Node dependencies | |
working-directory: ./scripts/pdf | |
run: | | |
npm install | |
- name: Build all pdfs | |
run: npm run pdf:build-all-ci | |
- name: Fix mtimes | |
run: npm run fix-mtimes | |
- name: Gatsby build | |
run: npm run build | |
env: | |
APP_ENV: production | |
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 | |
GTM_ID: GTM-5W8M67 | |
INDEX_ON_BUILD: true | |
- name: Deploy to Netlify | |
id: netlify-deploy | |
uses: nwtgck/actions-netlify@v3 | |
with: | |
publish-dir: "./public" | |
production-branch: "main" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
enable-commit-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_MAIN_SITE_ID }} | |
- uses: act10ns/slack@v2 | |
with: | |
status: ${{ job.status }} | |
if: always() | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |