Merge pull request #82 from trebol-ecommerce/chore/housekeeping #6
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: Documentation | |
on: | |
push: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
generate_documentation: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.5 | |
- name: Generate the static site | |
run: | | |
mkdir docs/ | |
npx @redocly/cli build-docs src/trebol-api.json --output=docs/index.html | |
- name: Upload static site as artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'docs/' | |
deploy_documentation: | |
needs: generate_documentation | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy artifact to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |