Generate Kubernetes Compatibility Matrix #10
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: Generate Kubernetes Compatibility Matrix | |
on: | |
repository_dispatch: # Allows other repositories to trigger this workflow | |
types: [generate-compatibility-matrix] | |
workflow_dispatch: | |
inputs: | |
min_rp_version: | |
description: 'Minimum Supported Redpanda Version' | |
required: true | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- 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 }} | |
- uses: aws-actions/aws-secretsmanager-get-secrets@v2 | |
with: | |
secret-ids: | | |
,sdlc/prod/github/actions_bot_token | |
,sdlc/prod/github/artifact_hub_api | |
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: Checkout this repository | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
repository: redpanda-data/docs | |
path: redpanda-docs | |
token: ${{ env.ACTIONS_BOT_TOKEN }} | |
- name: Install dependencies | |
run: cd scripts/generate-k8s-compatibility-matrix && npm install | |
- name: Run script to generate compatibility matrix | |
run: | | |
node scripts/generate-k8s-compatibility-matrix/generate-rp-matrix.js \ | |
${{ github.event.inputs.min_rp_version }} redpanda \ | |
> ./redpanda-docs/modules/upgrade/partials/k-redpanda-compatibility-matrix.adoc | |
node scripts/generate-k8s-compatibility-matrix/generate-rp-matrix.js \ | |
${{ github.event.inputs.min_rp_version }} console \ | |
> ./redpanda-docs/modules/upgrade/partials/k-redpanda-console-chart-dependencies.adoc | |
node scripts/generate-k8s-compatibility-matrix/generate-rp-matrix.js \ | |
${{ github.event.inputs.min_rp_version }} operator \ | |
> ./redpanda-docs/modules/upgrade/partials/k-operator-compatibility-matrix.adoc | |
# Check for any changes made in the documentation. | |
- name: Check if changes were made | |
id: check_changes | |
run: | | |
cd ./redpanda-docs | |
changes=$(git status --porcelain) | |
if [ -z "$changes" ]; then | |
echo "has_changes=false" >> $GITHUB_ENV | |
else | |
echo "has_changes=true" >> $GITHUB_ENV | |
fi | |
# If changes were detected, commit those changes. | |
- name: Commit changes | |
if: env.has_changes == 'true' | |
run: | | |
cd ./redpanda-docs | |
git config --global user.email "[email protected]" | |
git config --global user.name "vbotbuildovich" | |
git add . | |
git commit -m "auto-docs: Update K8s compatibility matrix" | |
git push origin main | |
env: | |
ACCESS_TOKEN: ${{ env.ACTIONS_BOT_TOKEN }} |