Merge pull request #820 from navikt/fjerne-deletedAt-felt #13
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: "Platform: generate docs" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- app/src/main/resources/produsent.graphql | |
workflow_dispatch: | |
jobs: | |
gendoc: | |
runs-on: 'ubuntu-latest' | |
permissions: | |
contents: "write" | |
pull-requests: "write" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- working-directory: ./docs | |
run: >- | |
npx spectaql config.yml | |
- working-directory: ./docs | |
run: mv gql/index.html api.html | |
- run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout -b docs/$GITHUB_SHA | |
git add -A | |
git commit -m "Autoupdate docs" | |
git push -u origin docs/$GITHUB_SHA | |
- name: Create Pull Request | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { repo, owner } = context.repo; | |
const result = await github.rest.pulls.create({ | |
title: '[bot] update api documentation for github pages', | |
owner, | |
repo, | |
head: 'docs/${{github.sha}}', | |
base: 'main', | |
body: [ | |
'Change in produsent-api graphql schema detected.', | |
'Automatically generated PR for new github pages.', | |
'plz accept.', | |
'' | |
].join('\n') | |
}); |