-
Notifications
You must be signed in to change notification settings - Fork 45
update: publish docs workflow #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
60a2d51
test: docs symlinking
namsnath 9bce975
update: upload entire python folder as artifact
namsnath 0e3a72f
Revert "test: docs symlinking"
namsnath 7a212cc
Reapply "test: docs symlinking"
namsnath 0ed2ec7
update: adds test workflow to check Py docs publish
namsnath 5b1768e
update: fix test workflow
namsnath 2552677
update: fix test workflow
namsnath ec9e9c6
update: test branch name
namsnath eef47b4
fix: test docs python paths
namsnath 0262b55
update: remove test workflow
namsnath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: "Update Docs - Test" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - synchronize | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| outputs: | ||
| constantsVersion: ${{ steps.versions.outputs.constantsVersion }} | ||
| constantsVersionXy: ${{ steps.versions.outputs.constantsVersionXy }} | ||
| setupVersion: ${{ steps.versions.outputs.setupVersion }} | ||
| setupVersionXy: ${{ steps.versions.outputs.setupVersionXy }} | ||
| newestVersion: ${{ steps.versions.outputs.newestVersion }} | ||
| targetBranch: ${{ steps.versions.outputs.targetBranch }} | ||
| devTag: ${{ steps.versions.outputs.devTag }} | ||
| releaseTag: ${{ steps.versions.outputs.releaseTag }} | ||
| versionFolder: ${{ steps.versions.outputs.versionFolder }} | ||
| artifactName: ${{ steps.versions.outputs.artifactName }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.branch }} | ||
| fetch-tags: true | ||
| token: ${{ secrets.ALL_REPO_PAT }} | ||
|
|
||
| - name: Populate variables | ||
| id: versions | ||
| run: | | ||
| . ./hooks/populate-hook-constants.sh | ||
|
|
||
| echo "constantsVersion=$constantsVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "constantsVersionXy=$constantsVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "setupVersion=$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "setupVersionXy=$setupVersionXy" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "newestVersion=$newestVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "targetBranch=$targetBranch" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
|
|
||
| echo "devTag=dev-v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "releaseTag=v$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
|
|
||
| echo "versionFolder=$setupVersionXy.X" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
| echo "artifactName=python-docs-$setupVersion" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV" | ||
|
|
||
| publish-docs: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ needs.setup.outputs.releaseTag }} | ||
| fetch-tags: true | ||
| path: supertokens-python | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| repository: supertokens/supertokens-backend-website | ||
| token: ${{ secrets.ALL_REPO_PAT }} | ||
| path: supertokens-backend-website | ||
|
|
||
| - run: | | ||
| shopt -s extglob # Enable extended globbing | ||
|
|
||
| pythonDocDir=supertokens-backend-website/app/docs/sdk/docs/python/ | ||
|
|
||
| # Delete the current version folder if it exists | ||
| rm -rf $pythonDocDir/${{ needs.setup.outputs.versionFolder }} | ||
| # Copy the current docs | ||
| mkdir -p $pythonDocDir/${{ needs.setup.outputs.versionFolder }} | ||
| cp -r supertokens-python/html/* $pythonDocDir/${{ needs.setup.outputs.versionFolder }} | ||
|
|
||
| if [[ "true" == "true" ]] | ||
namsnath marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| then | ||
| # Delete everything except the version folders | ||
| rm -rf $pythonDocDir/!(*.*.X) | ||
|
|
||
| # Copy files to the root dir | ||
| # cp -r supertokens-python/html/* $pythonDocDir/ | ||
|
|
||
| ln -s $pythonDocDir/${{ needs.setup.outputs.versionFolder }}/index.html $pythonDocDir/index.html | ||
| fi | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ needs.setup.outputs.artifactName }} | ||
| path: supertokens-backend-website/app/docs/sdk/docs/python | ||
|
|
||
| # - uses: actions/upload-artifact@v4 | ||
| # with: | ||
| # name: ${{ needs.setup.outputs.artifactName }} | ||
| # path: html/supertokens_python | ||
|
|
||
| - name: Trigger the backend website CI | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| # NOTE: We should use a better scoped PAT here. | ||
| github-token: ${{ secrets.ALL_REPO_PAT }} | ||
| script: | | ||
| github.rest.actions.createWorkflowDispatch({ | ||
| owner: 'supertokens', | ||
| repo: 'supertokens-backend-website', | ||
| workflow_id: 'release-python-documentation-changes.yml', | ||
| ref: 'feat/python-node-docs', | ||
| inputs: { | ||
| "version": `${{ needs.setup.outputs.setupVersion }}`, | ||
| "artifact-name": `${{ needs.setup.outputs.artifactName }}`, | ||
| "version-folder": `app/docs/sdk/docs/python`, | ||
| "is-latest": `${{ inputs.is-latest }}`, | ||
| "run-id": `${{ github.run_id }}`, | ||
| "stage": "preview", | ||
| } | ||
| }) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.