mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-01-28 21:30:43 +00:00
44 lines
1.1 KiB
YAML
44 lines
1.1 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@v6
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Install dependencies
|
|
run: npm install marked fs-extra marked-alert
|
|
|
|
- name: Generate website from README
|
|
run: |
|
|
node .github/generate-website.js
|
|
echo 'wts.knugi.dev' > ./docs/CNAME
|
|
|
|
- name: Deploy to gh-pages
|
|
if: github.ref == 'refs/heads/main' # Ensure deployment only happens from main
|
|
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs
|
|
publish_branch: gh-pages
|