Skip to content

fix: 尝试修复github action错误 #3

fix: 尝试修复github action错误

fix: 尝试修复github action错误 #3

Workflow file for this run

name: Publish OpenAPI Docs to GitHub Pages
on:
push:
branches:
- gh-pages
jobs:
publish-openapi-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install OpenAPI Generator CLI
run: npm install -g @openapitools/openapi-generator-cli
- name: Generate static site
run: openapi-generator-cli generate -i docs/summary.yaml -g html2 -o dist --additional-properties=info.title="My API""
- name: Commit changes to gh-pages branch
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git checkout -B gh-pages
rm -rf ./*
cp -r dist/* .
git add .
git commit -m "Publish OpenAPI Docs"
git push origin gh-pages --force