Skip to content

Update Generated Docs #348

Update Generated Docs

Update Generated Docs #348

name: Update Generated Docs
on:
workflow_dispatch:
inputs:
version:
description: "The new tolgee platform version to generate docs from."
jobs:
main:
name: Update docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.TOLGEE_MACHINE_PAT }}
- uses: actions/setup-node@v6
with:
node-version: "22.x"
- run: corepack enable
- name: Install npm dependencies
run: npm ci
- name: Set git globals
run: |
git config --local user.email "machine@tolgee.io"
git config --local user.name "Tolgee Machine"
- name: Login to docker
run: echo '${{ secrets.TOLGEE_MACHINE_PAT }}' | docker login ghcr.io -u USERNAME --password-stdin
- name: Run the app & wait
run: |
docker run --rm -d -p8080:8080 -e tolgee.billing.createPlansOnStartup=true ghcr.io/tolgee/tolgee-ee:${{ github.event.inputs.version }}
curl --retry 200 --retry-delay 1 -s --retry-all-errors "http://localhost:8080/swagger-ui/index.html" > /dev/null
- name: Generate the code
run: |
npm run generate-api-docs
npm run generate-platform-config
env:
TOLGEE_NEW_VERSION: ${{ github.event.inputs.version }}
API_SPEC_OVERRIDE_SERVER: https://app.tolgee.io
- name: Set git globals
run: |
git config --local user.email "machine@tolgee.io"
git config --local user.name "Tolgee Machine"
- name: Check for changes
id: changes
run: |
git add .
git update-index --refresh
CHANGED=$(git diff-index --quiet HEAD --; echo $?)
echo "changed=${CHANGED}" >> $GITHUB_OUTPUT
- name: Commit and push
if: steps.changes.outputs.changed == '1'
run: |
git add .
git commit -m "chore: Update generated docs to align with ${{ github.event.inputs.version }}"
git push origin main