-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (125 loc) · 5.08 KB
/
deploy-docs.yml
File metadata and controls
145 lines (125 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Deploy Documentation
on:
# Runs on pushes to main branch
push:
branches: [ main ]
# Allows manual triggering from the Actions tab
workflow_dispatch:
# Weekly schedule (Sunday at 2am UTC)
schedule:
- cron: '0 2 * * 0'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# Configure Git and perform checkout
- name: Configure Git
run: |
git config --global advice.detachedHead false
git config --global core.autocrlf false
git config --global status.submoduleSummary false
git config --global diff.ignoreSubmodules all
git config --global fetch.recurseSubmodules false
git config --global submodule.recurse false
git config --global submodule.active false
echo "Git configuration:"
git config --list
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
persist-credentials: false
set-safe-directory: /home/runner/work/mainwp.dev/mainwp.dev
# Verify theme files exist immediately after checkout
- name: Verify Theme Files After Checkout
run: |
echo "Listing workspace root:"
ls -la
echo "---"
echo "Checking dox-theme directory:"
ls -la dox-theme/ || echo "dox-theme directory NOT FOUND"
echo "---"
echo "Checking dox-theme/assets directory:"
ls -la dox-theme/assets/ || echo "dox-theme/assets directory NOT FOUND"
echo "---"
echo "Checking dox-theme/assets/js directory:"
ls -la dox-theme/assets/js/ || echo "dox-theme/assets/js directory NOT FOUND"
echo "---"
echo "Checking dox-theme/assets/js/vendor directory:"
ls -la dox-theme/assets/js/vendor/ || echo "dox-theme/assets/js/vendor directory NOT FOUND"
echo "---"
echo "Checking specific vendor file:"
ls -la dox-theme/assets/js/vendor/jquery.min.js || echo "jquery.min.js NOT FOUND"
- name: Verify repository state
run: |
echo "Repository structure:"
find . -maxdepth 3 -name ".git" | sort
echo "Checking for submodule entries:"
git config --list | grep submodule || echo "No submodule configs found"
echo "Checking Git index for submodule entries:"
git ls-files --stage | grep 160000 || echo "No submodule entries in index"
# Setup PHP
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, intl, zip
tools: composer:v2
# Setup Ruby for Jekyll
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
# Install dependencies
- name: Install Dependencies
run: |
cd hooks-generator
composer install --no-dev --prefer-dist --no-progress
cd ..
bundle install
# Clone MainWP repositories and remove .git directories
- name: Clone MainWP repos
run: |
# Clean up any existing source directories
rm -rf sources/mainwp-dashboard sources/mainwp-child
# Create fresh sources directory
mkdir -p sources
# Clone and clean dashboard repository
git clone https://github.com/mainwp/mainwp.git sources/mainwp-dashboard
rm -rf sources/mainwp-dashboard/.git
# Clone and clean child repository
git clone https://github.com/mainwp/mainwp-child.git sources/mainwp-child
rm -rf sources/mainwp-child/.git
# Verify no .git directories remain
echo "Checking for remaining .git directories:"
find sources -name ".git" -type d || echo "No .git directories found in sources"
# Generate hooks documentation
- name: Generate hooks documentation
run: |
cd hooks-generator
./generate-categorized-hooks.sh
# Build Jekyll site
- name: Build Jekyll
run: JEKYLL_ENV=production bundle exec jekyll build --verbose
env:
JEKYLL_ENV: production
# Verify build output and compiled assets
- name: Verify Build Output
run: |
echo "--- Workspace Root Contents ---"
ls -la
echo "--- _site Directory Contents ---"
ls -la _site
echo "--- _site/dox-theme/assets/js/ Contents (Recursive) ---"
ls -laR _site/dox-theme/assets/js/ || echo "Directory _site/dox-theme/assets/js/ not found"
echo "--- Compiled CSS Content ---"
echo "style.css contents:"
cat _site/dox-theme/assets/css/style.css || echo "style.css not found!"
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site # Deploy the contents of the _site directory
branch: gh-pages
clean: true # Automatically remove deleted files from the deploy branch