Skip to content

Index Redpanda Intruqt courses and upload to Algolia #48

Index Redpanda Intruqt courses and upload to Algolia

Index Redpanda Intruqt courses and upload to Algolia #48

---
name: Index Redpanda Intruqt courses and upload to Algolia
on:
schedule:
- cron: '0 21 * * 0' # Runs every Sunday at 9pm UTC
workflow_dispatch:
jobs:
update-algolia-index:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ vars.RP_AWS_CRED_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.RP_AWS_CRED_ACCOUNT_ID }}:role/${{ vars.RP_AWS_CRED_BASE_ROLE_NAME }}${{ github.event.repository.name }}
- name: get secrets from aws sm
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
,sdlc/prod/github/algolia
,sdlc/prod/github/instruqt_api_key
,sdlc/prod/github/actions_bot_token
parse-json-secrets: true
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: cd scripts/index-masterclasses && npm install
- name: Run indexing script
run: node scripts/index-masterclasses/index-masterclasses.js
env:
ALGOLIA_INDEX_NAME: redpanda
GITHUB_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }}
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "auto-docs: Update Instruqt records"
token: ${{ env.ACTIONS_BOT_TOKEN }}
branch: update-instruqt-records
title: "auto-docs: Update Instruqt records"
body: "Updates the Instruqt courses that are made available to docs for purposes such as automated cross-linking."
labels: auto-docs
reviewers: JakeSCahill, Deflaimun