Skip to content

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

Open
wants to merge 10 commits into
base: 0.30
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions .github/workflows/pipeline-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ jobs:
- setup
- release

outputs:
isLatest: ${{ steps.merge-check.outputs.isLatest }}

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -267,10 +270,13 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Check API and merge to master
id: merge-check
run: |
response=`curl -s -X GET "https://api.supertokens.io/0/driver/latest/check?password=${{ secrets.SUPERTOKENS_API_KEY }}&version=${{ needs.setup.outputs.setupVersion }}&name=python" -H 'api-version: 0'`
isLatest=$(echo $response | jq .isLatest)

echo "isLatest=$isLatest" | tee -a "$GITHUB_OUTPUT" "$GITHUB_ENV"

if [[ $isLatest == "true" ]]
then
git checkout master
Expand All @@ -288,17 +294,42 @@ jobs:
needs:
- setup
- release
- merge

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

if [[ "${{ needs.merge.outputs.isLatest }}" == "true" ]]
then
# Delete everything except the version folders
rm -rf supertokens-backend-website/app/docs/sdk/docs/python/!(*.*.X)
# Copy files to the root dir
cp -r supertokens-python/html/supertokens_python/* supertokens-backend-website/app/docs/sdk/docs/python/
fi

# Delete the current version folder if it exists
rm -rf supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }}
# Copy the current docs
mkdir -p supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }}
cp -r supertokens-python/html/supertokens_python/* supertokens-backend-website/app/docs/sdk/docs/python/${{ needs.setup.outputs.versionFolder }}

- uses: actions/upload-artifact@v4
with:
name: ${{ needs.setup.outputs.artifactName }}
path: html/supertokens_python
path: supertokens-backend-website/app/docs/sdk/docs/python

- name: Trigger the backend website CI
uses: actions/github-script@v7
Expand All @@ -314,7 +345,7 @@ jobs:
inputs: {
"version": `${{ needs.setup.outputs.setupVersion }}`,
"artifact-name": `${{ needs.setup.outputs.artifactName }}`,
"version-folder": `${{ needs.setup.outputs.versionFolder }}`,
"version-folder": `app/docs/sdk/docs/python`,
"run-id": `${{ github.run_id }}`,
"stage": "production",
}
Expand Down
Loading