Merge pull request #90 from sailpoint-oss/update/pushSDKDocWorkflow #65
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: "Push python SDK Docs to Developer Portal" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| push_spec_workflow: | |
| name: Push API spec changes | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref }} | |
| path: python-sdk | |
| - name: Checkout API Specs Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: sailpoint-oss/developer.sailpoint.com | |
| path: developer-community | |
| ref: main | |
| - name: Install rsync | |
| run: sudo apt update && sudo apt install -y rsync grsync | |
| - name: Sync files between folders | |
| run: | | |
| # v3 | |
| rsync -cav --delete python-sdk/sailpoint/v3/docs/Methods developer-community/docs/tools/sdk/python/Reference/V3 | |
| rsync -cav --delete python-sdk/sailpoint/v3/docs/Models developer-community/docs/tools/sdk/python/Reference/V3 | |
| rsync -av python-sdk/sailpoint/v3/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v3/ | |
| # beta | |
| rsync -cav --delete python-sdk/sailpoint/beta/docs/Methods developer-community/docs/tools/sdk/python/Reference/Beta | |
| rsync -cav --delete python-sdk/sailpoint/beta/docs/Models developer-community/docs/tools/sdk/python/Reference/Beta | |
| rsync -av python-sdk/sailpoint/beta/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/beta/ | |
| # v2024 | |
| rsync -cav --delete python-sdk/sailpoint/v2024/docs/Methods developer-community/docs/tools/sdk/python/Reference/V2024 | |
| rsync -cav --delete python-sdk/sailpoint/v2024/docs/Models developer-community/docs/tools/sdk/python/Reference/V2024 | |
| rsync -av python-sdk/sailpoint/v2024/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v2024/ | |
| # v2025 | |
| rsync -cav --delete python-sdk/sailpoint/v2025/docs/Methods developer-community/docs/tools/sdk/python/Reference/V2025 | |
| rsync -cav --delete python-sdk/sailpoint/v2025/docs/Models developer-community/docs/tools/sdk/python/Reference/V2025 | |
| rsync -av python-sdk/sailpoint/v2025/docs/Examples/python_code_examples_overlay.yaml developer-community/static/code-examples/v2025/ | |
| - name: Check for changes and commit if any | |
| run: | | |
| cd developer-community | |
| if git diff --quiet; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| git config --unset-all http.https://github.com/.extraheader | |
| git config --local user.email "devrel-service@sailpoint.com" | |
| git config --local user.name "developer-relations-sp" | |
| git add . | |
| git commit -m "Update python SDK docs: ${{ github.run_id }}" | |
| git remote set-url origin https://${{ secrets.DEVREL_SERVICE_TOKEN }}@github.com/sailpoint-oss/developer.sailpoint.com.git | |
| git push | |
| publish-failure: | |
| name: Notify on failure | |
| runs-on: ubuntu-latest | |
| needs: push_spec_workflow | |
| if: ${{ always() && (needs.push_spec_workflow.result == 'failure' || needs.push_spec_workflow.result == 'timed_out') }} | |
| steps: | |
| - name: Invoke GithubNotificationsFunction Lambda | |
| run: | | |
| curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "workflowName": "${{ github.job }}", | |
| "repositoryName": "${{ github.event.repository.name }}", | |
| "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| }' \ | |
| "${{ secrets.NOTIFICATIONS_FUNCTION_URL }}" |