diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1964bee..c59cd16 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -5,9 +5,6 @@ on: push: branches: - master - pull_request: - branches: - - master jobs: documentation: # Generate documentation and push to gh-pages branch using the predefined JDK versions in the strategy section @@ -26,28 +23,17 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'npm' - - run: npm install - - run: npm run docs + - name: Install tools + run: npm install - - name: Copy to documentation Website Location - run: | - mkdir ../gh-pages - cp -r docs/* ../gh-pages/ - cd ../gh-pages + - name: Generate Documentation + run: npm run docs - - name: Commit documentation changes - run: | - if [[ `git status --porcelain` ]]; then - echo "Commit documentation" - # Set identity - git config --global user.email "dev-git-action@paypal.com" - git config --global user.name "Git Action Doc" - - # Add branch - git checkout -B gh-pages - - # Push generated files - git add -A - git commit -m "Documentation updated" - git push origin gh-pages -fq > /dev/null - fi + - name: Push + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: gh-pages + FOLDER: docs + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MESSAGE: "Documentation updated"