Skip to content

Commit

Permalink
ci(platform): provide manual deployment of TypeDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwiehl committed Oct 31, 2024
1 parent 85f7bf1 commit 9208324
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Documentation Publication
name: Publish Developer Guide
on: workflow_dispatch
env:
NODE_VERSION: 20.14.0
Expand All @@ -19,8 +19,8 @@ jobs:
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
publish-documentation:
name: 'Publishing Documentation'
publish-developer-guide:
name: 'Publishing Developer Guide'
needs: install
runs-on: ubuntu-latest
steps:
Expand All @@ -35,19 +35,19 @@ jobs:
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Reading package.json version of scion/microfrontend-platform'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/package-json@master
id: package-json
id: microfrontend-platform-package-json
with:
path: projects/scion/microfrontend-platform/package.json
- name: 'Building Reference Documentation (Developer Guide)'
run: npm run microfrontend-platform:adoc -- -a revnumber=${{ steps.package-json.outputs.version }} -a revnumber-dasherized=${{ steps.package-json.outputs.version-dasherized }}
- name: 'Deploying Reference Documentation (Developer Guide) to Vercel'
- name: 'Building Developer Guide'
run: npm run microfrontend-platform:adoc -- -a revnumber=${{ steps.microfrontend-platform-package-json.outputs.version }} -a revnumber-dasherized=${{ steps.microfrontend-platform-package-json.outputs.version-dasherized }}
- name: 'Publishing Developer Guide to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/microfrontend-platform-developer-guide
vercel-token: ${{ secrets.VERCEL_TOKEN }}
org-id: ${{ secrets.VERCEL_ORG_ID }}
project-id: ${{ secrets.VERCEL_MICROFRONTEND_PLATFORM_DEVELOPER_GUIDE_PROJECT_ID }}
version: ${{ steps.package-json.outputs.version }}
version: ${{ steps.microfrontend-platform-package-json.outputs.version }}
aliases: |
microfrontend-platform-developer-guide.scion.vercel.app,
microfrontend-platform-developer-guide-v%v.scion.vercel.app
53 changes: 53 additions & 0 deletions .github/workflows/manual-workflow.publish-typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish TypeDoc
on: workflow_dispatch
env:
NODE_VERSION: 20.14.0
jobs:
install:
name: 'Installing NPM modules'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Caching NPM modules if necessary'
uses: actions/cache@v4
id: node-modules-cache
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
publish-typedoc:
name: 'Publishing TypeDoc'
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v4
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Reading package.json version of scion/microfrontend-platform'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/package-json@master
id: microfrontend-platform-package-json
with:
path: projects/scion/microfrontend-platform/package.json
- name: 'Building TypeDoc'
run: npm run microfrontend-platform:typedoc
- name: 'Publishing TypeDoc to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/microfrontend-platform-api
vercel-token: ${{ secrets.VERCEL_TOKEN }}
org-id: ${{ secrets.VERCEL_ORG_ID }}
project-id: ${{ secrets.VERCEL_MICROFRONTEND_PLATFORM_API_PROJECT_ID }}
version: ${{ steps.microfrontend-platform-package-json.outputs.version }}
aliases: |
microfrontend-platform-api.scion.vercel.app,
microfrontend-platform-api-v%v.scion.vercel.app
8 changes: 4 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Building @scion/microfrontend-platform'
run: npm run microfrontend-platform:build
- name: 'Building API Documentation (TypeDoc)'
- name: 'Building TypeDoc'
run: npm run microfrontend-platform:typedoc
- name: 'Building Reference Documentation (Developer Guide)'
- name: 'Building Developer Guide'
run: npm run microfrontend-platform:adoc -- -a revnumber=${{ steps.root-package-json.outputs.version }} -a revnumber-dasherized=${{ steps.root-package-json.outputs.version-dasherized }}
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
aliases: |
microfrontend-platform-devtools.scion.vercel.app,
microfrontend-platform-devtools-v%v.scion.vercel.app
- name: 'Publishing API Documentation (TypeDoc) to Vercel'
- name: 'Publishing TypeDoc to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/microfrontend-platform-api
Expand All @@ -249,7 +249,7 @@ jobs:
aliases: |
microfrontend-platform-api.scion.vercel.app,
microfrontend-platform-api-v%v.scion.vercel.app
- name: 'Publishing Reference Documentation (Developer Guide) to Vercel'
- name: 'Publishing Developer Guide to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/microfrontend-platform-developer-guide
Expand Down

0 comments on commit 9208324

Please sign in to comment.