Skip to content

Merge pull request #820 from navikt/fjerne-deletedAt-felt #13

Merge pull request #820 from navikt/fjerne-deletedAt-felt

Merge pull request #820 from navikt/fjerne-deletedAt-felt #13

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.',
'![Gif found on CodeReviewGifs.com hosted on Giphy.com](https://media.giphy.com/media/R4uJVLXbOVDBS/giphy.gif)'
].join('\n')
});