-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9395cc3
commit a2db1a3
Showing
12 changed files
with
203 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,26 +2,43 @@ name: docs | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'documentation/**' | ||
- '*.yml' | ||
|
||
branches: | ||
- master | ||
env: | ||
SITE_DIR: "gh-pages" | ||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-18.04 | ||
build_site: | ||
name: "Build site with Antora" | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: "Generate site using antora site action" | ||
uses: kameshsampath/antora-site-action@master | ||
with: | ||
antora_playbook: site.yml | ||
- name: "Upload generated site" | ||
uses: actions/[email protected] | ||
with: | ||
name: site | ||
path: "${{ github.workspace }}/${{ env.SITE_DIR }}" | ||
deploy_site: | ||
runs-on: [ubuntu-latest] | ||
needs: [build_site] | ||
name: "Deploy GitHub Pages" | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
- name: Run antora | ||
uses: docker://antora/antora:2.2.0 | ||
with: | ||
args: github-pages-site.yml | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: "${{github.token}}" | ||
FOLDER: gh-pages | ||
BRANCH: gh-pages | ||
COMMIT_MESSAGE: "[docs] Publishing the docs for commit(s) ${{github.sha}}" | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Download generated site | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: site | ||
path: "${{ github.workspace }}/${{ env.SITE_DIR }}" | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
# ACCESS_TOKEN: # optional | ||
GITHUB_TOKEN: "${{ github.token}}" | ||
FOLDER: "${{ env.SITE_DIR }}" | ||
BRANCH: "gh-pages" | ||
COMMIT_MESSAGE: "[CI] Publish Documentation for ${{ github.sha }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ istio-1.1.1 | |
firebase* | ||
yarn* | ||
package* | ||
!package.json | ||
node_modules | ||
.firebaserc | ||
.firebase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1 @@ | ||
Fork this repo and adjust the next content: | ||
|
||
_In all `/*-site.yml`_ | ||
|
||
`site.title` [*] | ||
`site.url` | ||
`content.sources.tags`, usually as a first version you should remove this section, but you can leave it as well if you plan to use tags for releasing. | ||
_`supplemental-ui/`_ | ||
`img/favicon.ico` to your icon. Now it uses the RHD icon. | ||
`partials/header-content` change the *Template Tutorial* to the name of the tutorial. | ||
|
||
_`documentation/antora.yml`_ | ||
|
||
`site.title` to [*] | ||
`site.name` to the name of the tutorial | ||
Check the build courseware https://redhat-scholars.github.io/build-course[documentation] on how folder structure, how to use macros and other gotchas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
runtime: | ||
cache_dir: ./.cache/antora | ||
|
||
site: | ||
title: Template Tutorial(Dev Mode) | ||
url: http://localhost:3000/rhs-build-course/index.html | ||
start_page: template-tutorial::index.adoc | ||
|
||
content: | ||
sources: | ||
- url: . | ||
branches: HEAD | ||
start_path: documentation | ||
asciidoc: | ||
attributes: | ||
title: Template Tutorial(Dev Mode) | ||
extensions: | ||
- ./lib/remote-include-processor.js | ||
- ./lib/tab-block.js | ||
ui: | ||
bundle: | ||
url: https://github.com/redhat-scholars/course-ui/releases/download/v0.1.1/ui-bundle.zip | ||
snapshot: true | ||
supplemental_files: ./supplemental-ui | ||
output: | ||
dir: ./gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: template-tutorial | ||
title: Template Tutorial | ||
version: '1.0.x' | ||
version: master | ||
nav: | ||
- modules/ROOT/nav.adoc | ||
- modules/ROOT/nav.adoc | ||
|
||
start_page: ROOT:index.adoc | ||
start_page: ROOT:index.adoc |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/*jshint esversion: 6 */ | ||
|
||
import { series, watch } from "gulp"; | ||
import { remove } from "fs-extra"; | ||
import { readFileSync } from "fs"; | ||
import {load as yamlLoad} from "yaml-js"; | ||
import generator from "@antora/site-generator-default"; | ||
import browserSync from "browser-sync"; | ||
|
||
const filename = "dev-site.yml"; | ||
const server = browserSync.create(); | ||
const args = ["--playbook", filename]; | ||
|
||
//Watch Paths | ||
function watchGlobs() { | ||
let json_content = readFileSync(`${__dirname}/${filename}`, "UTF-8"); | ||
let yaml_content = yamlLoad(json_content); | ||
let dirs = yaml_content.content.sources.map(source => [ | ||
`${source.url}/**/**.yml`, | ||
`${source.url}/**/**.adoc`, | ||
`${source.url}/**/**.hbs` | ||
]); | ||
dirs.push(["dev-site.yml"]); | ||
dirs = [].concat(...dirs); | ||
//console.log(dirs); | ||
return dirs; | ||
} | ||
|
||
const siteWatch = () => watch(watchGlobs(), series(build, reload)); | ||
|
||
const removeSite = done => remove("gh-pages", done); | ||
const removeCache = done => remove(".cache", done); | ||
|
||
function build(done) { | ||
generator(args, process.env) | ||
.then(() => { | ||
done(); | ||
}) | ||
.catch(err => { | ||
console.log(err); | ||
done(); | ||
}); | ||
} | ||
|
||
function workshopSite(done){ | ||
generator(["--pull", "--stacktrace","--playbook","workshop-site.yaml"], process.env) | ||
.then(() => { | ||
done(); | ||
}) | ||
.catch(err => { | ||
console.log(err); | ||
done(); | ||
}); | ||
} | ||
|
||
function reload(done) { | ||
server.reload(); | ||
done(); | ||
} | ||
|
||
function serve(done) { | ||
server.init({ | ||
server: { | ||
baseDir: "./gh-pages" | ||
} | ||
}); | ||
done(); | ||
} | ||
|
||
const _build = build; | ||
export { _build as build }; | ||
const _clean = series(removeSite, removeCache); | ||
export { _clean as clean }; | ||
const _default = series(_clean, build, serve, siteWatch); | ||
export { _default as default }; | ||
//build workshop docs | ||
const _wsite = series(_clean, workshopSite); | ||
export { _wsite as workshopSite }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "rhs-openshift-admins-devops", | ||
"description": "OpenShift Admins Devops Course Documentation Site", | ||
"homepage": "https://redhat-scholars.github.io/openshift-admins-devops", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "Kamesh Sampath", | ||
"url": "https://twitter.com/@kamesh_sampath" | ||
}, | ||
"dependencies": { | ||
"@antora/cli": "^2.3.1", | ||
"@antora/site-generator-default": "^2.3.1", | ||
"@babel/cli": "^7.5.5", | ||
"@babel/core": "^7.5.5", | ||
"@babel/polyfill": "^7.4.4", | ||
"@babel/preset-env": "^7.5.5", | ||
"@babel/register": "^7.5.5", | ||
"browser-sync": "^2.26.7", | ||
"fs-extra": "^8.1.0", | ||
"gulp": "^4.0.0", | ||
"yaml-js": "^0.2.3" | ||
}, | ||
"devDependencies": {}, | ||
"scripts": { | ||
"dev": "gulp", | ||
"clean": "gulp clean", | ||
"workshop": "gulp workshopSite" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/redhat-scholars/openshift-admins-devops.git" | ||
}, | ||
"license": "Apache-2.0", | ||
"babel": { | ||
"presets": [ | ||
"@babel/preset-env" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
_CURR_DIR="$( cd "$(dirname "$0")" ; pwd -P )" | ||
rm -rf $_CURR_DIR/gh-pages $_CURR_DIR/.cache | ||
|
||
antora --pull --stacktrace site.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters