Skip to content

Commit

Permalink
ci(Release): Add documentation automation job (#117)
Browse files Browse the repository at this point in the history
* ci(Release): Add documentation automation job

* chore: Update .gitignore

* deps(Dev): Remove typedoc-plugin-example-tag
  • Loading branch information
ardalanamini authored Aug 14, 2022
1 parent c53e246 commit 74bbe74
Show file tree
Hide file tree
Showing 175 changed files with 72 additions and 20,044 deletions.
78 changes: 68 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

env:
NODE_VERSION: 16

jobs:
test:
uses: ./.github/workflows/test.yml
Expand Down Expand Up @@ -58,16 +61,20 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/

- run: npm ci
- name: Install dependencies
run: npm ci

- run: npm run build:hybrid
- name: Build the project
run: npm run build:hybrid

- run: npm publish
- name: Publish the package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -94,18 +101,69 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}
registry-url: https://npm.pkg.github.com/
scope: '@ardalanamini'

- run: sed -i 's/"name":\ "prototyped.js"/"name":\ "@ardalanamini\/prototyped.js"/g' package.json package-lock.json

- run: npm ci
- name: Install dependencies
run: npm ci

- run: npm run build:hybrid
- name: Build the project
run: npm run build:hybrid

- run: npm publish
- name: Publish the package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-documents:
name: Publish Documents

needs:
- publish-npm

permissions:
contents: read
pages: write
id-token: write

environment:
name: documents
url: ${{ steps.github-pages-deployment.outputs.page_url }}

concurrency:
group: ${{ github.workflow }}-pages-${{ github.ref_name }}
cancel-in-progress: true

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Generate code documents
run: npm run docs

- name: Setup Pages
uses: actions/configure-pages@v1

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs/'

- name: Deploy to GitHub Pages
id: github-pages-deployment
uses: actions/deploy-pages@v1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,6 @@ dist
# Build
build/

# Documents
docs/

1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

106 changes: 0 additions & 106 deletions docs/assets/highlight.css

This file was deleted.

54 changes: 0 additions & 54 deletions docs/assets/main.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/search.js

This file was deleted.

Loading

0 comments on commit 74bbe74

Please sign in to comment.