Skip to content

Commit 6420886

Browse files
authored
Merge pull request #1 from ttelang/patch-1
Generating Antora ui-bundle for MicroProfile tutorial
2 parents 542a77f + a0c00fd commit 6420886

File tree

127 files changed

+35344
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+35344
-24
lines changed

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "MicroProfile Tutorial UI",
3+
"features": {
4+
"ghcr.io/devcontainers/features/node:1": {
5+
"version": "lts"
6+
}
7+
},
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"asciidoctor.asciidoctor-vscode",
12+
"github.vscode-github-actions"
13+
]
14+
}
15+
},
16+
"postCreateCommand": "npm install -g gulp-cli && npm install"
17+
}

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
node: true,
5+
es6: true
6+
},
7+
extends: 'eslint:recommended',
8+
parserOptions: {
9+
ecmaVersion: 2018,
10+
sourceType: 'module'
11+
},
12+
rules: {
13+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
14+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn'
15+
}
16+
}

.github/pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build:
2+
artifact: "public"

.github/workflows/build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: build
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
build:
12+
name: Build and publish UI bundle
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Set up NodeJS 18
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '18.x'
22+
23+
- name: Build project
24+
run: npm install
25+
26+
- name: Create UI bundle
27+
run : gulp bundle
28+
29+
- name: If pushed to main, delete 'latest' tag if any
30+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
31+
uses: actions/github-script@v3
32+
with:
33+
github-token: ${{secrets.GITHUB_TOKEN}}
34+
script: |
35+
try {
36+
await github.git.deleteRef({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
ref: "tags/latest"
40+
})
41+
console.log("The 'latest' tag has been deleted")
42+
} catch (e) {
43+
console.log("The 'latest' tag doesn't exist yet: " + e)
44+
}
45+
46+
- name: If pushed to main, set 'latest' tag on current build
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
48+
uses: mathieudutour/[email protected]
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
tag_prefix: ''
52+
custom_tag: latest
53+
54+
- name: If pushed to main or tagged, publish UI bundle
55+
if: github.event_name == 'push'
56+
uses: softprops/action-gh-release@v1
57+
with:
58+
name: Latest UI bundle
59+
files: build/ui-bundle.zip
60+
tag_name: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'latest' }}
61+
62+
- name: If published, trigger redeployment of playbook
63+
if: github.event_name == 'push' && !failure() && !cancelled()
64+
continue-on-error: true
65+
uses: convictional/[email protected]
66+
with:
67+
github_token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
68+
owner: ttelang
69+
repo: microprofile-documentation
70+
workflow_file_name: build-and-deploy.yml
71+
wait_interval: 3
72+
wait_workflow: false
73+
propagate_failure: false

.github/workflows/github-pages.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '18'
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Build site
33+
run: npx gulp github-pages
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v4
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: './public'
42+
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
# Compiled class file
2-
*.class
1+
# Project specific
2+
/build/
3+
/public/
34

4-
# Log file
5-
*.log
5+
# Node.js
6+
/node_modules/
67

7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
12-
13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
8+
# Eclipse
9+
.settings/
10+
*.classpath
11+
*.project

.stylelintrc.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"rules": {
4+
"indentation": 2,
5+
"string-quotes": null,
6+
"no-duplicate-selectors": true,
7+
"color-hex-case": "lower",
8+
"color-hex-length": "short",
9+
"color-named": "never",
10+
"selector-no-qualifying-type": null,
11+
"selector-combinator-space-after": "always",
12+
"selector-attribute-quotes": "always",
13+
"selector-attribute-operator-space-before": "never",
14+
"selector-attribute-operator-space-after": "never",
15+
"selector-attribute-brackets-space-inside": "never",
16+
"declaration-block-trailing-semicolon": "always",
17+
"declaration-colon-space-before": "never",
18+
"declaration-colon-space-after": "always",
19+
"declaration-colon-newline-after": null,
20+
"number-leading-zero": "always",
21+
"function-url-quotes": null,
22+
"font-weight-notation": null,
23+
"font-family-name-quotes": "always-where-recommended",
24+
"comment-whitespace-inside": "always",
25+
"at-rule-no-vendor-prefix": true,
26+
"rule-empty-line-before": null,
27+
"selector-pseudo-element-colon-notation": "double",
28+
"selector-pseudo-class-parentheses-space-inside": "never",
29+
"media-feature-range-operator-space-before": "always",
30+
"media-feature-range-operator-space-after": "always",
31+
"media-feature-parentheses-space-inside": "never",
32+
"media-feature-colon-space-before": "never",
33+
"media-feature-colon-space-after": "always",
34+
"no-descending-specificity": null,
35+
"comment-empty-line-before": null,
36+
"declaration-empty-line-before": null
37+
}
38+
}

0 commit comments

Comments
 (0)