Skip to content

Commit

Permalink
edit doc uploader script
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Pennati committed Apr 17, 2024
1 parent a2baba6 commit 7aa6c91
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions upload-redoc-static-html-to-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ if [ -z "$1" ]; then
exit 1
fi

DOC_REPO_URL="git@github.com:opendatamesh-initiative/odm-api-doc.git"
DOC_REPO_NAME="odm-api-doc"
DOC_REPO_URL="git@github.com:opendatamesh-initiative/odm-site-platform.git"
DOC_REPO_NAME="odm-site-platform"
DOC_DIR="odm-site-platform/docs/assets/redoc/doc"
SCRIPT_DIR="docs/assets/redoc/scripts"
VERSION="$1"

# Clone doc repository
git clone $DOC_REPO_URL
cd $DOC_REPO_NAME
cd $DOC_DIR

if [ -d "$VERSION" ]; then

echo "Subdirectory $VERSION exists. Overriding its content..."

# Move files to the subdirectory
cp ../redocly-docs/* $VERSION
cp ../../../../../redocly-docs/* $VERSION

else

Expand All @@ -29,12 +31,13 @@ else
mkdir $VERSION

# Move files to the subdirectory
cp ../redocly-docs/* $VERSION
cp ../../../../../redocly-docs/* $VERSION

fi

# Generate index.html for github pages
./ghpagesgenerator.sh
cd ../../../../
./$SCRIPT_DIR/updateDocPage.sh

# Add changes to the staging area
git add .
Expand All @@ -43,7 +46,10 @@ git add .
git commit -m "Override or create subdirectory $DIRECTORY and add docs inside it"

# Push changes
git push origin master
git push origin main
git checkout pre-deploy
git merge main --no-edit
git push

# Clean up
cd ..
Expand Down

0 comments on commit 7aa6c91

Please sign in to comment.