Skip to content

Commit

Permalink
feat: add GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorin committed Aug 18, 2022
1 parent 120acdf commit 932f5e8
Show file tree
Hide file tree
Showing 19 changed files with 1,327 additions and 28 deletions.
71 changes: 55 additions & 16 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
name: Continous Integration
name: Continuous Integration

on: [ push, pull_request ]
on: [ release ]

jobs:
Build:
name: Build
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup node"
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
scope: '@tmorin'
node-version: '16.x'
- name: "Install system dependencies"
run: sudo apt install graphviz zip
- name: "Cache Node.js modules"
Expand All @@ -30,23 +29,24 @@ jobs:
run: npm test
- name: "Create .cache directory"
run: mkdir -p .cache
- name: "Zip distribution artifact"
- name: "Create tmorin-plantuml-libs.zip"
run: zip -r ../.cache/tmorin-plantuml-libs.zip *
working-directory: distribution
- name: "Upload the artifacts"
- name: "Upload tmorin-plantuml-libs.zip"
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
.cache/tmorin-plantuml-libs.zip
GithubRelease:
name: Github Release
runs-on: ubuntu-20.04
name: "Github Release"
runs-on: ubuntu-latest
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v2
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Download all artifacts"
uses: actions/download-artifact@v2
- name: "Create the release"
Expand All @@ -59,17 +59,56 @@ jobs:
draft: false
token: ${{ secrets.GITHUB_TOKEN }}

GithubPages:
name: "Github Pages"
runs-on: ubuntu-latest
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup Node"
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: "Cache Node.js modules"
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: "Install dependencies"
run: npm ci --no-progress
- name: "Build summary"
run: npm run generate:website
- name: "Create tmorin-plantuml-public.zip"
run: zip -r ../tmorin-plantuml-public.zip *
working-directory: public
- name: "Upload tmorin-plantuml-public.zip"
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
tmorin-plantuml-public.zip
- name: "Publish Github Pages"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

NpmPublication:
name: NPM Publication
runs-on: ubuntu-20.04
name: "NPM Publication"
runs-on: ubuntu-latest
needs: [ Build ]
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v2
- name: "Checkout repository"
uses: actions/checkout@v3
- name: "Setup node"
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@tmorin'
- name: "Install system dependencies"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/library-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
name: Generate the working directory
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: "Setup NodeJs"
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16.x'
- name: "Cache the dependencies"
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
container: docker://thibaultmorin/plantuml-generator:1
needs: [ generate-workdir ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand All @@ -87,7 +87,7 @@ jobs:
runs-on: ubuntu-20.04
needs: [ generate-package ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v2
- name: "Refresh the distribution directory"
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/package-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
name: Generate the workdir
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: "Setup NodeJs"
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16.x'
- name: "Cache the dependencies"
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
container: docker://thibaultmorin/plantuml-generator:1
needs: [ generate-workdir ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
Expand All @@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-20.04
needs: [ generate-distribution ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: "Delete distribution"
run: rm -Rf distribution
- uses: actions/download-artifact@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
.tmp/
.workdir/
test/*.png
/public*
library.yaml
node_modules
*.tgz
/distribution/SUMMARY.md
/distribution/CHANGELOG.md
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
/scripts
/source
/test
/public
/workdir-generator
tsconfig.json
/distribution/SUMMARY.md
/distribution/CHANGELOG.md
9 changes: 5 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.tmp
.workdir
node_modules
/.idea
/.tmp
/.workdir
/node_modules
/distribution
19 changes: 19 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[book]
title = "tmorin/plantuml-libs"
authors = ["Thibault Morin"]
description = "A set of PlantUML libraries and a NPM cli tool to design diagrams which focus on several technologies/approaches: Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), C4 Model or even EventStorming and more."

src = "distribution"

[build]
build-dir = "public" # the directory where the output is placed
create-missing = false # whether or not to create missing pages
use-default-preprocessors = true # use the default preprocessors

[output.html]
git-repository-url = "https://github.com/tmorin/plantuml-libs"
git-repository-icon = "fa-github"

[output.html.fold]
enable = true # whether or not to enable section folding
level = 0 # the depth to start folding
Loading

0 comments on commit 932f5e8

Please sign in to comment.