From 85a1c6cee848a1390f6cc4fd17af8a2fdd3eae8c Mon Sep 17 00:00:00 2001 From: pa Date: Wed, 11 Sep 2024 07:40:07 +0000 Subject: [PATCH 1/2] init fork pages --- .github/workflows/publish-pages-on-forks.yml | 58 ++++++++++++++ .gitignore | 3 + docs/index.md | 5 ++ mkdocs.yml | 81 ++++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 .github/workflows/publish-pages-on-forks.yml create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/.github/workflows/publish-pages-on-forks.yml b/.github/workflows/publish-pages-on-forks.yml new file mode 100644 index 00000000..5b8af70f --- /dev/null +++ b/.github/workflows/publish-pages-on-forks.yml @@ -0,0 +1,58 @@ +--- +name: marp-and-mkdocs-to-pages +concurrency: marp-and-mkdocs-to-pages +on: + push: + branches: [ '**' ] + paths: + - slides/** + - docs/** + - mkdocs.yml + - img/** + - .github/workflows/publish-pages-on-forks.yml + # also trigger if lab archives changed + - demos/** + - .devcontainer/** + workflow_dispatch: + branches: [ '**' ] +permissions: + contents: write + pages: write + id-token: write +jobs: + build: + if: github.repository != 'aristanetworks/aclabs' + runs-on: ubuntu-22.04 + steps: + + - name: Checkout code ✅ + uses: actions/checkout@v4 + + - name: find-branch + id: find_branch + run: | + echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + + - name: Setup Python3 🐍 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Build MkDocs Site + run: | + pip install mkdocs-material + pip install mkdocs-macros-plugin + pip install mdx_truly_sane_lists + mkdocs build + + - name: Setup Pages 📖 + uses: actions/configure-pages@v5 + + - name: Upload artifact 🔼 + uses: actions/upload-pages-artifact@v3 + with: + path: ./site/ + + - name: Deploy to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 6ff04dc9..f6faabc7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ # license files *license*.json + +# ignore mkdocs serve privacy cache +.cache diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..c810f90e --- /dev/null +++ b/docs/index.md @@ -0,0 +1,5 @@ +# Arista Community Labs + +!!! Warning "WARNING!" + + Under construction! diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..80330a02 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,81 @@ +--- +site_name: Arista Community Labs +site_url: https://aclabs.arista.com +repo_name: Arista Community Labs +repo_url: https://github.com/aristanetworks/aclabs + +# extra_css: +# - assets/stylesheets/extra.css + +theme: + name: material + features: + - announce.dismiss + - content.code.annotate + - content.code.copy + # - content.code.select + - content.footnote.tooltips + # - content.tabs.link + - content.tooltips + - header.autohide + # - navigation.expand + - navigation.indexes + # - navigation.instant + # - navigation.instant.prefetch + # - navigation.instant.progress + # - navigation.prune + # - navigation.sections + - navigation.tabs + # enabling prune for testing only, to check if it's stable + # it's not making any difference with current site setup + - navigation.prune + # - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + # - toc.integrate + + font: + text: Roboto + code: Roboto Mono + favicon: assets/favicon.png + icon: + repo: fontawesome/brands/github + logo: fontawesome/solid/gears + +markdown_extensions: + - attr_list + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.critic + - pymdownx.caret + - pymdownx.keys + - pymdownx.mark + - pymdownx.tilde + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.tabbed: + alternate_style: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format + # allows list ident with 2 spaces + - mdx_truly_sane_lists + +copyright: > +  🍪 Change cookie settings + +plugins: + - privacy + - search + +nav: + - Home: + - Home: index.md From f0a8694d05f6d6552a70800a292a1f0e9016b260 Mon Sep 17 00:00:00 2001 From: pa Date: Wed, 11 Sep 2024 07:48:45 +0000 Subject: [PATCH 2/2] init pages on parent repo --- .github/workflows/publish-pages.yml | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/publish-pages.yml diff --git a/.github/workflows/publish-pages.yml b/.github/workflows/publish-pages.yml new file mode 100644 index 00000000..4ec53486 --- /dev/null +++ b/.github/workflows/publish-pages.yml @@ -0,0 +1,53 @@ +--- +name: marp-and-mkdocs-to-pages +concurrency: marp-and-mkdocs-to-pages +on: + push: + branches: [ main ] + paths: + - slides/** + - docs/** + - mkdocs.yml + - img/** + - .github/workflows/publish-pages.yml + # also trigger if lab archives changed + - demos/** + - .devcontainer/** + workflow_dispatch: + branches: [main] +permissions: + contents: write + pages: write + id-token: write +jobs: + build: + if: github.repository == 'aristanetworks/aclabs' + runs-on: ubuntu-22.04 + steps: + + - name: Checkout code ✅ + uses: actions/checkout@v4 + + - name: Setup Python3 🐍 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Build MkDocs Site + run: | + pip install mkdocs-material + pip install mkdocs-macros-plugin + pip install mdx_truly_sane_lists + mkdocs build + + - name: Setup Pages 📖 + uses: actions/configure-pages@v5 + + - name: Upload artifact 🔼 + uses: actions/upload-pages-artifact@v3 + with: + path: ./site/ + + - name: Deploy to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4