diff --git a/.github/workflows/publish-doc-release.yml b/.github/workflows/publish-doc-release.yml index f77e305..3f7f45c 100644 --- a/.github/workflows/publish-doc-release.yml +++ b/.github/workflows/publish-doc-release.yml @@ -10,29 +10,7 @@ on: jobs: publish-doc-release: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate and prepare documentation - uses: eclipse-keypop/keypop-actions/doxygen@v2 - with: - repo-name: ${{ github.event.repository.name }} - version: ${{ github.event.inputs.version || github.ref_name }} - - - name: Deploy to doc branch - run: | - git config --global user.name "Eclipse Keypop Bot" - git config --global user.email "${{ github.repository }}-bot@eclipse.org" - cd ${{ github.event.repository.name }} - git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - git add . - git commit -m "docs: update ${{ github.event.inputs.version || github.ref_name }} documentation" - git push origin doc --force - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main + with: + version: ${{ github.event.inputs.version || github.ref_name }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/publish-doc-snapshot.yml b/.github/workflows/publish-doc-snapshot.yml index 5e55b74..9560db2 100644 --- a/.github/workflows/publish-doc-snapshot.yml +++ b/.github/workflows/publish-doc-snapshot.yml @@ -7,28 +7,5 @@ on: jobs: publish-doc-snapshot: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate and prepare documentation - uses: eclipse-keypop/keypop-actions/doxygen@v2 - with: - repo-name: ${{ github.event.repository.name }} - - - name: Deploy to doc branch - run: | - git config --global user.name "Eclipse Keypop Bot" - git config --global user.email "${{ github.repository }}-bot@eclipse.org" - cd ${{ github.event.repository.name }} - git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" - git add . - git diff --quiet && git diff --staged --quiet || git commit -m "docs: update snapshot documentation" - git push origin doc --force - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: eclipse-keypop/keypop-actions/.github/workflows/reusable-publish-doxygen.yml@main + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/publish-to-keypop-doc.yml b/.github/workflows/publish-to-keypop-doc.yml deleted file mode 100644 index 708c341..0000000 --- a/.github/workflows/publish-to-keypop-doc.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Trigger Centralized Documentation Update - -on: - workflow_run: - workflows: ['Publish API documentation (snapshot)', 'Publish API documentation (release)'] - types: - - completed - workflow_dispatch: - -permissions: - checks: write - -jobs: - check-secret: - runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' - outputs: - has-token: ${{ steps.check.outputs.has-token }} - steps: - - id: check - run: | - if [ "${{ secrets.ORG_GITHUB_BOT_TOKEN }}" != "" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - - notify-doc-site: - needs: check-secret - if: needs.check-secret.outputs.has-token == 'true' - runs-on: ubuntu-latest - steps: - - name: Repository Dispatch Event - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.ORG_GITHUB_BOT_TOKEN }} - repository: eclipse-keypop/keypop-api-docs - event-type: update-submodules