Skip to content

Commit

Permalink
Experiments with GH pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Aug 3, 2023
1 parent dff9519 commit e8fbe6d
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/build-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build GH Page

on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'otterdog/*.jsonnet'
- 'otterdog/*.json'

concurrency:
group: "pages"
cancel-in-progress: false

permissions:
contents: read

jobs:
generate-markdown:
# do not run the workflow in the template repo itself
if: ${{ !contains (github.repository, '/.eclipsefdn-template') }}
runs-on: ubuntu-latest
steps:
- name: Checkout OtterDog
run: git clone https://gitlab.eclipse.org/eclipsefdn/security/otterdog.git

- name: Checkout EclipseFdn/otterdog-configs
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
repository: EclipseFdn/otterdog-configs
path: otterdog-configs

# checkout the HEAD ref
- name: Checkout HEAD
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: ${{ github.repository_owner }}

- name: Install jsonnet-bundler
run: |
go install -a github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
echo $(go env GOPATH)/bin >> $GITHUB_PATH
- name: Install poetry
run: pipx install poetry

- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
with:
python-version: '3.10'
cache: 'poetry'

- name: Install dependencies with poetry
run: |
poetry install --only=main
working-directory: otterdog

- name: Copy configuration from HEAD ref
run: |
mkdir -p orgs/${{ github.repository_owner }}
cp -r ../${{ github.repository_owner }}/otterdog/* orgs/${{ github.repository_owner }}
working-directory: otterdog-configs

- name: Generate default configuration as markdown
run: ../otterdog/otterdog.sh show-default ${{ github.repository_owner }} -c otterdog.json --markdown > default.md
working-directory: otterdog-configs

- name: Upload default.md
uses: actions/upload-artifact@v3
with:
name: default-text
path: otterdog-configs/default.txt

build-page:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download default-text
uses: actions/download-artifact@v3
with:
name: default-text
- shell: bash
run: |
cat default.txt >> ./docs/index.md
- uses: actions/setup-python@v4
with:
python-version: 3.x
cache: 'pip'
- run: pip install -r requirements.txt
- name: Build with Mkdocs
run: mkdocs build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

8 changes: 8 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
hide:
- navigation
- toc
---

# Default configuration

19 changes: 19 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
site_name: Otterdog configuration @ adoptium
site_description: Otterdog configuration @ adoptium
strict: true

site_url: https://adoptium.github.io/.eclipsefdn/
docs_dir: ./docs
site_dir: ./_site

theme:
name: 'material'

markdown_extensions:
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true

plugins: []
nav: []
watch: []
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mkdocs-material

0 comments on commit e8fbe6d

Please sign in to comment.