feat: Add .gitignore file to exclude unnecessary files and directories #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Javadoc | |
| on: | |
| push: | |
| branches: ['main'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: publish-javadoc | |
| cancel-in-progress: true | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: maven | |
| - name: Ensure submodule spec exists | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| git submodule sync --recursive | |
| git submodule update --init --recursive | |
| test -d ucp/spec || (echo "Missing ucp/spec (UCP submodule not initialized?)" && ls -la && exit 1) | |
| - name: Build Javadoc (HTML) | |
| run: | | |
| cd sdk | |
| mvn -DskipTests clean generate-sources javadoc:javadoc | |
| - name: Checkout site gh-pages | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Open-Commerce-Protocol/io.deeplumen | |
| ref: gh-pages | |
| token: ${{ secrets.IO_DEEPLUMEN_PAGES_TOKEN }} | |
| path: io.deeplumen-pages | |
| - name: Sync apidocs into site | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| DEST="io.deeplumen-pages/ucp-sdk/apidocs" | |
| rm -rf "$DEST" | |
| mkdir -p "$DEST" | |
| cp -R sdk/target/site/apidocs/* "$DEST/" | |
| touch io.deeplumen-pages/.nojekyll | |
| - name: Commit and push | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd io.deeplumen-pages | |
| if [[ -z "$(git status --porcelain)" ]]; then | |
| echo "No changes to publish." | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add ucp-sdk/apidocs .nojekyll | |
| git commit -m "docs(ucp-sdk): publish javadoc" | |
| git push |