61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: Documentation
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths: [ 'docs/**', 'README.md' ]
|
|
|
|
jobs:
|
|
deploy-docs:
|
|
name: Deploy Documentation
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
npm install -g @vuepress/cli vuepress
|
|
|
|
- name: Build documentation
|
|
run: |
|
|
# Create docs structure for VuePress
|
|
mkdir -p .vuepress
|
|
cat > .vuepress/config.js <<EOF
|
|
module.exports = {
|
|
title: 'Ansible LEMP WordPress',
|
|
description: 'Automated LEMP stack and WordPress deployment',
|
|
base: '/ansible-lemp-wordpress/',
|
|
themeConfig: {
|
|
nav: [
|
|
{ text: 'Home', link: '/' },
|
|
{ text: 'Guide', link: '/docs/' },
|
|
{ text: 'GitHub', link: 'https://github.com/spalencsar/ansible-lemp-wordpress' }
|
|
],
|
|
sidebar: [
|
|
'/',
|
|
'/docs/production-deployment',
|
|
'/docs/ssl-setup',
|
|
'/docs/troubleshooting',
|
|
'/docs/vault',
|
|
'/docs/multi-environment-deployment'
|
|
]
|
|
}
|
|
}
|
|
EOF
|
|
|
|
# Build docs
|
|
vuepress build .
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./.vuepress/dist
|