mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-02-10 19:22:24 +00:00
42 lines
1.0 KiB
YAML
42 lines
1.0 KiB
YAML
name: Generate Website from README
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'README.md'
|
|
- '.github/workflows/generate-website.yml'
|
|
- '.github/generate-website.js'
|
|
- '.github/docs.html'
|
|
workflow_dispatch:
|
|
permissions:
|
|
contents: write
|
|
pages: write
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm install marked fs-extra marked-alert
|
|
|
|
- name: Generate website from README
|
|
run: node .github/generate-website.js
|
|
|
|
- name: Deploy to gh-pages
|
|
if: github.ref == 'refs/heads/main' # Ensure deployment only happens from main
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs
|
|
publish_branch: gh-pages
|