Skip to content

Commit

Permalink
Do not push the whole repo to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
darksylinc committed Sep 20, 2020
1 parent 7d186e8 commit 04364af
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/doxygen_remove_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python

import os
import shutil

keep_files = [
'api',
'images',
'javascripts',
'stylesheets',
'vtests',
'.git',
'_config.yml',
'index.md',
'ogre-logo.png',
'.nojekyll',
]

for root, dirs, filenames in os.walk( '../../' ):
for fileName in filenames:
if fileName not in keep_files:
toRemove = os.path.join( root, fileName )
print( 'Removing ' + toRemove )
for dir in dirs:
if dir not in keep_files:
toRemove = os.path.join( root, dir )
print( 'Removing ' + toRemove )
shutil.rmtree( toRemove )
break
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
with:
doxyfile-path: './Doxyfile'

- name: Remove files
working-directory: .github/workflows/
run: python3 doxygen_remove_files.py

- name: Publish # Only on master branch
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
Expand Down

0 comments on commit 04364af

Please sign in to comment.