-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: switch to poetry Signed-off-by: moabu <[email protected]> * ci: move into docs folder Signed-off-by: moabu <[email protected]> * ci: fix running poetry run Signed-off-by: moabu <[email protected]> * ci: fix running poetry run Signed-off-by: moabu <[email protected]> * ci: fix running poetry run Signed-off-by: moabu <[email protected]> * ci: fix running poetry run Signed-off-by: moabu <[email protected]> * ci: force checkout and ignore any changes Signed-off-by: moabu <[email protected]> --------- Signed-off-by: moabu <[email protected]>
- Loading branch information
Showing
6 changed files
with
1,045 additions
and
89 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -55,11 +55,13 @@ jobs: | |
with: | ||
python-version: "3.10" | ||
cache: pip | ||
cache-dependency-path: docs/requirements.txt | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --require-hashes -r docs/requirements.txt | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export PATH="$HOME/.local/bin:$PATH" | ||
cp docs/pyproject.toml docs/poetry.lock ../ | ||
poetry install --no-root | ||
cp mkdocs.yml ../ | ||
- name: Checkout jans ${{ github.event.inputs.version }} | ||
|
@@ -97,7 +99,7 @@ jobs: | |
git config --global user.name "mo-auto" | ||
git config --global user.email "[email protected]" | ||
git config --global user.signingkey "${{ steps.import_gpg.outputs.keyid }}" | ||
echo "${{ secrets.MOAUTO_WORKFLOW_TOKEN }}" | gh auth login --with-token | ||
echo "${{ secrets.MOAUTO_WORKFLOW_TOKEN }}" | gh auth login --with-token | ||
- name: Generate docs | ||
continue-on-error: true | ||
|
@@ -115,45 +117,42 @@ jobs: | |
git checkout -b cn-jans-update-auto-generated-docs | ||
git pull origin cn-jans-update-auto-generated-docs || echo "Nothing to pull" | ||
echo "Custom work on generating docs can go here." | ||
# Run cn docs | ||
# Run cn docs | ||
sudo bash ./automation/docs/generated-cn-docs.sh . || echo "something went wrong with generating the cn docs" | ||
echo "Generating auto-generated docs and push to main" | ||
sudo bash ./automation/docs/generate-autogenerated-docs.sh . || echo "something went wrong with generating the property docs" | ||
cd docs | ||
git add . || echo "Nothing to add" | ||
git commit -a -S -m "docs: auto-generated property docs" || echo "Nothing to commit" | ||
cd .. | ||
echo "Add jans-config-api Swagger SPECs that are auto-generated via API annotations" | ||
sudo bash ./automation/docs/generate-swagger-specs.sh . || echo "something went wrong with generating the swagger docs" | ||
cd jans-config-api/docs | ||
git add . || echo "Nothing to add" | ||
git commit -a -S -m "docs: auto-generated Swagger SPEC docs" || echo "Nothing to commit" | ||
cd ../.. | ||
git push --set-upstream origin cn-jans-update-auto-generated-docs | ||
MESSAGE="fix(docs): autogenerate docs" | ||
PR=$(gh pr create --body "Auto generated docs" --title "${MESSAGE}") | ||
cd ../../ | ||
sudo rm -rf temp | ||
- name: mike deploy ${{ github.event.inputs.version }} | ||
if: >- | ||
github.event_name == 'workflow_dispatch' | ||
run: | | ||
mike deploy --push --force ${{ github.event.inputs.version }} | ||
poetry run mike deploy --push --force ${{ github.event.inputs.version }} | ||
# This deploys the current docs into gh-pages/head on merges to main | ||
# The old "main" gets deleted if it exists, head is more descriptive | ||
- name: mike deploy head | ||
if: contains(github.ref, 'refs/heads/main') && github.event_name != 'workflow_dispatch' | ||
run: | | ||
mike deploy --push head | ||
poetry run mike deploy --push head | ||
# If a release has been published, deploy it as a new version | ||
- name: mike deploy new version | ||
if: >- | ||
github.event_name == 'release' && | ||
|
@@ -163,11 +162,9 @@ jobs: | |
env: | ||
VERSION: ${{ github.event.release.tag_name }} | ||
run: | | ||
mike deploy --push "$VERSION" | ||
poetry run mike deploy --push "$VERSION" | ||
- name: Update mike version aliases | ||
#if: >- | ||
# github.event_name != 'workflow_dispatch' | ||
id: set_versions | ||
run: | | ||
GITHUB_EVENT_RELEASE_TAG_NAME="${{ github.event.release.tag_name }}" | ||
|
@@ -178,44 +175,28 @@ jobs: | |
LATEST='nightly' | ||
fi | ||
echo "Latest is $LATEST and Stable is $STABLE" | ||
# remove below two lines after first release | ||
#LATEST="head" | ||
#STABLE="head" | ||
mike alias -u head main | ||
mike alias -u "${STABLE}" stable | ||
mike set-default --push stable | ||
poetry run mike alias -u head main | ||
poetry run mike alias -u "${STABLE}" stable | ||
poetry run mike set-default --push stable | ||
echo "LATEST=${LATEST}" >> $GITHUB_OUTPUT | ||
echo "STABLE=${STABLE}" >> $GITHUB_OUTPUT | ||
# Ensures the current branch is gh-pages, | ||
# Creates / updates the "stable" and "latest" plain text files with the corresponding versions | ||
# Commits if the files were changed | ||
# Finally pushes if there are unpushed commits | ||
- name: Create version files | ||
#if: >- | ||
# github.event_name != 'workflow_dispatch' | ||
run: | | ||
LATEST=${{ steps.set_versions.outputs.LATEST }} | ||
STABLE=${{ steps.set_versions.outputs.STABLE }} | ||
git checkout gh-pages | ||
git checkout -f gh-pages | ||
git pull origin gh-pages | ||
# move generated chart from a previous step | ||
mv ../janssen-*.tgz ./charts/ | ||
cd ./charts | ||
git add janssen-*.tgz && git update-index --refresh | ||
helm repo index . | ||
git add index.yaml && git update-index --refresh | ||
cd .. | ||
# END move generated chart from a previous step | ||
# copy search from nightly to all other versions. This is to ensure that the search index is available for all versions | ||
for folder in v*/; do | ||
cp -r nightly/search "$folder" | ||
git add $folder/search && git update-index --refresh | ||
done | ||
# END copy search from nightly to all other versions | ||
echo "Replacing release number markers with actual release number" | ||
cd ${LATEST} | ||
if [[ "${LATEST}" == "nightly" ]]; then | ||
egrep -lRZ --exclude=CONTRIBUTING.md . | xargs -0 -l sed -i -e "s/replace-janssen-version-stable/0.0.0-nightly/g" | ||
|
@@ -231,7 +212,6 @@ jobs: | |
git rm -r $folder/admin/reference/javadocs || echo "Nothing to remove" | ||
fi | ||
done | ||
# Replace scarf url | ||
sed -i -e "s/placeholder-scarf-pixel-url/https:\/\/static.scarf.sh\/a.png?x-pxid=2c347abc-a9b4-4c4b-bdc9-2682edbcc0c9/g" ${STABLE}/overrides/main.html | ||
git add ${STABLE}/overrides/main.html && git update-index --refresh | ||
git diff-index --quiet HEAD -- || git commit -S -m "docs: update scarf pixel url" | ||
|
@@ -241,4 +221,4 @@ jobs: | |
echo "${LATEST}" > latest.txt | ||
git add latest.txt && git update-index --refresh | ||
git diff-index --quiet HEAD -- || git commit -S -m "Set latest to ${LATEST}" | ||
git push origin gh-pages | ||
git push origin gh-pages |
This file contains 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
Oops, something went wrong.