Skip to content

Sync CRN Algolia

Sync CRN Algolia #162

name: Sync CRN Algolia
on:
workflow_dispatch:
inputs:
entity:
required: false
type: choice
description: Choose which entity to sync
default: all
options:
- events
- external-authors
- interest-groups
- manuscripts
- news
- research-outputs
- teams
- tutorials
- users
- working-groups
- all
environment-name:
required: true
type: environment
description: Choose which environment to sync
default: Branch
contentful-environment-id:
required: true
type: string
description: The contentful environment to sync from
default: Development
pr-number:
required: false
type: string
description: The PR number to run for
jobs:
algolia:
uses: ./.github/workflows/reusable-crn-algolia-sync.yml
with:
environment-name: ${{ github.event.inputs.environment-name }}
entity: ${{ github.event.inputs.entity }}
pr-number: ${{ github.event.inputs.pr-number }}
crn-create-env: ${{ inputs.environment-name == 'Branch' }}
contentful-environment-id: ${{ github.event.inputs.contentful-environment-id }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
CRN_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CRN_CONTENTFUL_ACCESS_TOKEN }}
CONTENTFUL_MANAGEMENT_TOKEN: ${{ secrets.CONTENTFUL_MANAGEMENT_TOKEN }}
notify_failure:
runs-on: ubuntu-latest
needs: [algolia]
if: ${{ failure() && github.event.inputs.environment-name=='Production' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/slack/
with:
message: CRN Algolia Prod Sync
webhook: ${{ secrets.SLACK_WEBHOOK }}
status: failure