Skip to content

generate website from README. #18

generate website from README.

generate website from README. #18

name: Generate Website
run-name: generate website from README.
on:
workflow_run:
workflows: ["Generate README"]
types:
- completed
workflow_dispatch: # For manual triggering (optional)
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }} && github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Prepare the README for static generator
- run: cp README.md website/content/_index.md
- run: "sed -i '1i ---\\ntemplate: index.html\\n---\\n' website/content/_index.md"
# Build and deploy to gh-pages branch
- name: build_and_deploy
uses: shalzz/[email protected]
env:
PAGES_BRANCH: gh-pages
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_DIR: './website'