Skip to content

Commit 07e964f

Browse files
authored
Initial commit
0 parents  commit 07e964f

23 files changed

+802
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on: workflow_dispatch
2+
3+
name: Create gh-pages branch
4+
5+
jobs:
6+
create-branch:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- name: Deploy
12+
uses: peaceiris/actions-gh-pages@v4
13+
with:
14+
github_token: ${{ secrets.GITHUB_TOKEN }}
15+
publish_dir: ./
16+
force_orphan: true

.github/workflows/mirror.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches: main
5+
6+
name: Mirror to Internal
7+
env:
8+
GITHUB_TOKEN: ${{ secrets.GH_ENTERPRISE_TOKEN }}
9+
GHE_USER: ${{ vars.SYNC_USER }}
10+
GHE_FULL_USER: ${{ vars.SYNC_USER_NAME }}
11+
ENTERPRISE_URL: ${{ vars.ENTERPRISE_GIT_URL }}
12+
ENTERPRISE_EMAIL: ${{ vars.SYNC_USER_EMAIL }}
13+
TEMPLATE_NAME: 'ibm-client-engineering/solution-template-quarto'
14+
CEBOT_GH_TRAVIS_TOKEN: ${{ secrets.CEBOT_GH_TRAVIS_TOKEN }}
15+
CEBOT_TRAVIS_API_KEY: ${{ secrets.CEBOT_TRAVIS_API_KEY }}
16+
TRAVIS_API_ENDPOINT: ${{ vars.TRAVIS_API_ENDPOINT }}
17+
18+
jobs:
19+
verify_and_mirror:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check if remote enterprise repo exists
23+
id: repocheck
24+
if: ${{github.repository == env.TEMPLATE_NAME}}
25+
run: git ls-remote https://${{ env.GHE_USER }}:${{ env.GITHUB_TOKEN }}@${{ env.ENTERPRISE_URL }}/${{ github.repository }} -q --exit-code
26+
- name: Create remote repo
27+
if: ${{ failure() && steps.repocheck.conclusion == 'failure' && github.repository == env.TEMPLATE_NAME}}
28+
run: |
29+
echo ${{ env.GITHUB_TOKEN }} > /tmp/token.txt
30+
gh auth login -p https -h ${{ env.ENTERPRISE_URL }} --with-token < /tmp/token.txt
31+
gh repo create --public ${{ github.repository }}
32+
- name: Checkout repo and all branches to stage
33+
id: checkout
34+
if: ${{github.repository == env.TEMPLATE_NAME}}
35+
uses: actions/checkout@v4
36+
with:
37+
repository: ${{ github.repository }}
38+
fetch-depth: 0
39+
- name: Mirror the repo up to our internal github
40+
id: mirror
41+
if: ${{github.repository == env.TEMPLATE_NAME}}
42+
uses: yesolutions/mirror-action@master
43+
with:
44+
REMOTE: 'https://${{ env.ENTERPRISE_URL }}/${{ github.repository }}'
45+
GIT_USERNAME: ${{ env.GHE_USER }}
46+
GIT_PASSWORD: ${{ env.GITHUB_TOKEN }}
47+
- name: Set Travis Var (gh token)
48+
id: travis
49+
if: ${{github.repository == env.TEMPLATE_NAME}}
50+
env:
51+
REPO_NAME: "solution-template-quarto"
52+
run: |
53+
curl -X POST \
54+
-H "Content-Type: application/json" \
55+
-H "Travis-API-Version: 3" \
56+
-H "Authorization: token ${{ env.CEBOT_TRAVIS_API_KEY }}" \
57+
-d '{ "env_var.name": "GITHUB_TOKEN", "env_var.value": "${{ env.CEBOT_GH_TRAVIS_TOKEN }}", "env_var.public": false }' \
58+
${{ env.TRAVIS_API_ENDPOINT }}/repo/${{ github.repository_owner }}%2F${{ env.REPO_NAME }}/env_vars

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches: main
5+
6+
name: Quarto Publish
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Quarto
18+
uses: quarto-dev/quarto-actions/setup@v2
19+
20+
- name: Install Python and Dependencies
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.10'
24+
cache: 'pip'
25+
- run: pip install jupyter
26+
- run: pip install -r requirements.txt
27+
28+
- name: Render and Publish
29+
uses: quarto-dev/quarto-actions/publish@v2
30+
with:
31+
target: gh-pages
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
# cronjob trigger
3+
schedule:
4+
- cron: "0 0 * * 1"
5+
# manual trigger
6+
workflow_dispatch:
7+
8+
name: Quarto Template Sync
9+
10+
jobs:
11+
repo-sync:
12+
runs-on: ubuntu-latest
13+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
# To use this repository's private action, you must check out the repository
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
# https://github.com/actions/checkout#usage
23+
# uncomment if you use submodules within the source repository
24+
# with:
25+
# submodules: true
26+
27+
- name: actions-template-sync
28+
uses: AndreasAugustin/actions-template-sync@v2
29+
with:
30+
source_repo_path: ibm-client-engineering/solution-template-quarto
31+
upstream_branch: main # defaults to main
32+
pr_labels: template_sync # defaults to template_sync

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.quarto/
2+
/_site
3+
/docs/*
4+
5+
!docs/docsfile
6+
_quarto_internal_scss_error.scss

.templatesyncignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:!src/custom.scss
2+
*

.travis.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
language: python
2+
python:
3+
- "3.9"
4+
5+
branches:
6+
only:
7+
- main
8+
9+
# env:
10+
# - GITHUB_TOKEN: $secrets.GITHUB_TOKEN
11+
12+
jobs:
13+
include:
14+
- stage: build and deploy pages
15+
before_install:
16+
- rm ~/.netrc
17+
install:
18+
- pip install quarto-cli
19+
script:
20+
- quarto render --output-dir build
21+
# script:
22+
# - quarto publish gh-pages --no-prompt --no-browser --token $GITHUB_TOKEN
23+
24+
before_deploy:
25+
- rvm --default use 2.7.6
26+
deploy:
27+
- provider: pages
28+
edge:
29+
branch: v1.10.16
30+
github_url: github.ibm.com
31+
github_token: $GITHUB_TOKEN
32+
target_branch: gh-pages
33+
skip_cleanup: true
34+
local_dir: build
35+
on:
36+
branch: main
37+
38+
stages:
39+
- build and deploy pages

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# IBM Client Engineering Solutions Documentation Template
2+
3+
## What is this?
4+
This is a template used to quickly and effectively document assets and solutions created by Client Engineers at IBM. The template outlines the bare minimum requirements that must be documented when publishing your work.
5+
6+
## Install Quarto
7+
To be able to build and view changes locally for these docs you will need to install the appropriate version of Quarto via Command Line:
8+
`pip install quarto-cli` or `brew install --cask quarto` and ensure one of the tools below is installed:
9+
* VS Code
10+
* Jupyter
11+
* RStudio
12+
* Neovim
13+
* Text Editor
14+
15+
If the command line install does not work, you can download quarto here: https://quarto.org/docs/download/
16+
17+
## How do I use it?
18+
1. Change the `title` on line 9 of the `_quarto.yml` file to the appropriate Project Name of the solution doc.
19+
2. Change the `href` on line 21 of the `_quarto.yml` file to the reflect the link to the repo of the newly created solution doc. Ex. https://github.com/ibm-client-engineering/[repo-name]
20+
4. Assuming that Quarto is already installed, navigate to the appropriate directory with the cloned solution doc repository and run `quarto preview index.qmd` to preview your build locally.

_quarto.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
project:
2+
type: website
3+
output-dir: docs
4+
5+
language:
6+
search-text-placeholder: Search
7+
8+
website:
9+
title: Solutions Hub
10+
favicon: images/bee.png
11+
page-navigation: true
12+
search:
13+
type: textbox
14+
show-item-context: true
15+
location: navbar
16+
navbar:
17+
pinned: true
18+
logo: images/IBMlogo.png
19+
right:
20+
- icon: github
21+
href: https://github.com/ibm-client-engineering/solution-template-quarto
22+
target: "_blank"
23+
- icon: linkedin
24+
menu:
25+
- text: Share on your LinkedIn
26+
href: http://linkedin.com/post
27+
target: "_blank"
28+
- text: IBM LinkedIn
29+
href: https://www.linkedin.com/company/ibm/
30+
target: "_blank"
31+
sidebar:
32+
- title: "Contents"
33+
style: docked
34+
collapse-level: 1
35+
search: false
36+
contents:
37+
- href: index.qmd
38+
text: Problem Definition
39+
- section: Solution Overview
40+
contents:
41+
- text: Prepare
42+
href: src/solution_overview/prepare.qmd
43+
- text: Environment
44+
href: src/solution_overview/environment.qmd
45+
- text: Troubleshooting
46+
href: src/solution_overview/troubleshooting.qmd
47+
- section: Implementation Methodology
48+
contents:
49+
- text: Step One
50+
href: src/implementation_methodology/stepone-imp.qmd
51+
- text: Step Two
52+
href: src/implementation_methodology/steptwo-imp.qmd
53+
- text: Step Three
54+
href: src/implementation_methodology/stepthree-imp.qmd
55+
- text: Key Takeaways
56+
href: src/key-takeaway.qmd
57+
58+
59+
page-footer:
60+
background: black
61+
left:
62+
<div class ="listitem"><a href="https://ibm.com" rel="noopener noreferrer" class="footerLogo"><img src="https://www.ibm.com/brand/experience-guides/developer/8f4e3cc2b5d52354a6d43c8edba1e3c9/02_8-bar-reverse.svg" alt="IBM Logo" class="footer__logo themedComponent_node_modules-@docusaurus-theme-common-lib-components-ThemedComponent-styles-module themedComponent--light_node_modules-@docusaurus-theme-common-lib-components-ThemedComponent-styles-module" width="250" height="250"></a></div>
63+
64+
65+
format:
66+
html:
67+
theme: src/custom.scss
68+
toc: true
69+
toc-location: right
70+
71+
72+

images/IBMlogo.png

30.7 KB
Loading

0 commit comments

Comments
 (0)