Skip to content

Merge pull request #574 from IngridT1/updateshortdesc #160

Merge pull request #574 from IngridT1/updateshortdesc

Merge pull request #574 from IngridT1/updateshortdesc #160

Workflow file for this run

name: Build and deploy SSG website
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Extract assets
run: docker cp $(docker run --detach quay.io/redhat-docs/redhat-docs-template):/assets ./supplementary_style_guide/assets
- name: Build AsciiDoc
uses: docker://quay.io/redhat-docs/redhat-docs-template
with:
args: supplementary_style_guide/main.adoc
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: Generate Markdown with downdoc
run: |
gem install asciidoctor-reducer
cd supplementary_style_guide
asciidoctor-reducer main.adoc -o main-reduced.adoc
npx downdoc main-reduced.adoc -o ssg.md
sed -i \
-e 's/{nbsp}/ /g' \
-e 's/ / /g' \
-e 's|<dl><dt><strong>📌 NOTE</strong></dt><dd>|> **NOTE:**|g' \
-e 's|<dl><dt><strong>❗ IMPORTANT</strong></dt><dd>|> **IMPORTANT:**|g' \
-e 's|<dl><dt><strong>⚠️ WARNING</strong></dt><dd>|> **WARNING:**|g' \
-e 's|</dd></dl>||g' \
-e 's|image:images/yes.png\[yes\] ||g' \
-e 's|image:images/no.png\[no\] ||g' \
-e 's|image:images/caution.png\[with caution\] ||g' \
-e 's|image:images/caution.png\[caution\] ||g' \
-e 's|image:images/yes.png\[yes\]-||g' \
-e 's|image:images/no.png\[no\]-||g' \
-e 's|image:images/caution.png\[with-caution\]-||g' \
-e 's|image:images/caution.png\[caution\]-||g' \
-e 's|,-|-|g' \
-e 's|-(|-|g' \
-e 's|))|)|g' \
ssg.md
- name: Copy output to docs/
run: |
mkdir docs
cp -r supplementary_style_guide/images/ docs/images
cp -r supplementary_style_guide/assets/ docs/assets
mv index.html docs/
cp supplementary_style_guide/ssg.md docs/
- name: Publish to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs