Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: gh-pages

- name: Set up Java 11
uses: actions/setup-java@v4
Expand All @@ -52,7 +53,8 @@ jobs:

- name: Publish Javadocs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TAG: ${{ github.ref_name}}
run: |
Expand Down
18 changes: 8 additions & 10 deletions build/publishJavadoc-gha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ printf "\n>>>>> Publishing javadoc for release build: repo=%s tag=%s\n" ${GITHUB

printf "\n>>>>> Cloning repository's gh-pages branch into directory 'gh-pages'\n"
rm -fr ./gh-pages
git config --global user.email "devxsdk@us.ibm.com"
git config --global user.name "ibm-devx-sdk"
git clone --branch=gh-pages https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git gh-pages
git config --global url."x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git"
# git config --global user.email "devxsdk@us.ibm.com"
# git config --global user.name "ibm-devx-sdk"
# git clone --branch=gh-pages https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git gh-pages
# git config --global url."x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git"
# Configure the remote URL with the token for pushing
# git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git
printf "\n>>>>> GH version...\n"
gh --version
printf "\n>>>>> GH auth status...\n"
gh auth status

git config --global user.email "devxsdk@us.ibm.com"
git config --global user.name "ibm-devx-sdk"
git clone --branch=gh-pages https://${GH_TOKEN}@github.com/IBM/platform-services-java-sdk.git gh-pages
printf "\n>>>>> Finished cloning...\n"

pushd gh-pages
Expand All @@ -39,8 +38,7 @@ printf "\n>>>>> Added files...\n"
git commit -m "docs: latest javadoc for ${GITHUB_TAG}"
printf "\n>>>>> Committed changes...\n"
git remote -v
# git push -f origin gh-pages
git push --repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO_SLUG}.git" -f gh-pages
git push -f origin gh-pages
printf "\n>>>>> Pushed changes...\n"

popd
Expand Down