Skip to content

Commit

Permalink
Add workflow to build & deploy API docs on release
Browse files Browse the repository at this point in the history
  • Loading branch information
aabounegm committed Sep 23, 2024
1 parent 2cbc161 commit 47109f3
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ permissions:
on:
release:
types: [published]
# To manually trigger a rebuild of the API docs if needed
workflow_dispatch:

jobs:
publish:
name: Langium Publish
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.event_name == 'release' }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -56,3 +59,31 @@ jobs:
PACKAGE_VERSION=`npm pkg get version --workspaces=false | tr -d \"`
vsce package
ovsx publish langium-vscode-$PACKAGE_VERSION.vsix -p ${{ secrets.OVSX_TOKEN }}
docs:
name: Build and publish API docs
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Build API docs
run: |
npm ci
npm run docs -w langium
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: pacakges/langium/docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 47109f3

Please sign in to comment.