Skip to content

Commit

Permalink
Merge pull request #135 from commerce-docs/fix-indexing-workflow
Browse files Browse the repository at this point in the history
Increase memory to fix indexing workflow failures
  • Loading branch information
jeff-matthews authored Sep 13, 2023
2 parents b41c816 + 7b124bc commit a3eabd9
Showing 1 changed file with 60 additions and 39 deletions.
99 changes: 60 additions & 39 deletions .github/workflows/index.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,61 @@
---
name: Indexing
on:
schedule:
- cron: '42 20 1 * *'
workflow_dispatch:
inputs:
mode:
description: 'Type of indexing. "index" to push to Algolia, "console" for dry run.'
required: true
default: 'index'
type: choice
options:
- console
- index

jobs:
build-and-index:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Yarn Install
uses: bahmutov/npm-install@v1
- name: Build
run: |
yarn build
env:
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_BRANCH: ${{ github.ref_name }}
GATSBY_ALGOLIA_APPLICATION_ID: ${{ secrets.AIO_ALGOLIA_APPLICATION_ID }}
GATSBY_ALGOLIA_SEARCH_API_KEY: ${{ secrets.AIO_ALGOLIA_SEARCH_API_KEY }}
ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }}
ALGOLIA_INDEXATION_MODE: ${{ github.event.inputs.mode || 'index' }}
GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com
name: Indexing
on:
schedule:
- cron: '42 20 1 * *'
workflow_dispatch:
inputs:
mode:
description: 'Type of indexing. "index" to push to Algolia, "console" for dry run.'
required: true
default: 'index'
type: choice
options:
- console
- index

jobs:
build-and-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node v16 for Yarn v3
uses: actions/setup-node@v3
with:
node-version: '16.15.0' # Current LTS version

- name: Enable Corepack for Yarn v3
run: corepack enable

- name: Install Yarn v3
uses: borales/actions-yarn@v4
with:
cmd: set version stable

- name: Install dependencies
uses: borales/actions-yarn@v4
with:
cmd: install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false

- name: Build site
uses: borales/actions-yarn@v4
with:
cmd: build
env:
NODE_OPTIONS: "--max_old_space_size=8192"
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_BRANCH: ${{ github.ref_name }}
GATSBY_ALGOLIA_APPLICATION_ID: ${{ secrets.AIO_ALGOLIA_APPLICATION_ID }}
GATSBY_ALGOLIA_SEARCH_API_KEY: ${{ secrets.AIO_ALGOLIA_SEARCH_API_KEY }}
ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }}
ALGOLIA_INDEXATION_MODE: ${{ github.event.inputs.mode || 'index' }}
GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com

0 comments on commit a3eabd9

Please sign in to comment.