|
| 1 | +--- |
| 2 | +name: Indexing |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '42 20 1 * *' |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + mode: |
| 9 | + description: 'Type of indexing. "index" to push to Algolia, "console" for dry run.' |
| 10 | + required: true |
| 11 | + default: 'index' |
| 12 | + type: choice |
| 13 | + options: |
| 14 | + - console |
| 15 | + - index |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-and-index: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - name: Setup Node v16 for Yarn v3 |
| 24 | + uses: actions/setup-node@v3 |
| 25 | + with: |
| 26 | + node-version: '16.15.0' # Current LTS version |
| 27 | + |
| 28 | + - name: Enable Corepack for Yarn v3 |
| 29 | + run: corepack enable |
| 30 | + |
| 31 | + - name: Install Yarn v3 |
| 32 | + uses: borales/actions-yarn@v4 |
| 33 | + with: |
| 34 | + cmd: set version stable |
| 35 | + |
| 36 | + - name: Install dependencies |
| 37 | + uses: borales/actions-yarn@v4 |
| 38 | + with: |
| 39 | + cmd: install |
| 40 | + env: |
| 41 | + YARN_ENABLE_IMMUTABLE_INSTALLS: false |
| 42 | + |
| 43 | + - name: Build site |
| 44 | + uses: borales/actions-yarn@v4 |
| 45 | + with: |
| 46 | + cmd: build |
| 47 | + env: |
| 48 | + PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build' |
| 49 | + REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + REPO_OWNER: ${{ github.repository_owner }} |
| 51 | + REPO_NAME: ${{ github.event.repository.name }} |
| 52 | + REPO_BRANCH: ${{ github.ref_name }} |
| 53 | + GATSBY_ALGOLIA_APPLICATION_ID: ${{ secrets.AIO_ALGOLIA_APPLICATION_ID }} |
| 54 | + GATSBY_ALGOLIA_SEARCH_API_KEY: ${{ secrets.AIO_ALGOLIA_SEARCH_API_KEY }} |
| 55 | + ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }} |
| 56 | + ALGOLIA_INDEXATION_MODE: ${{ github.event.inputs.mode || 'index' }} |
| 57 | + GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }} |
| 58 | + GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }} |
| 59 | + GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com |
0 commit comments