From dc3f4020f10f8774a2e9269df5b66903e2b49bd5 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Thu, 4 Jul 2024 14:13:17 +0300 Subject: [PATCH] Fix CI Pipelines --- .github/workflows/automated-publish-docs.yaml | 6 +- .github/workflows/delete-deployments.yaml | 64 --------- .github/workflows/mike-delete-all.yaml | 134 +++++++++--------- 3 files changed, 71 insertions(+), 133 deletions(-) delete mode 100644 .github/workflows/delete-deployments.yaml diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index b7b0162d93..e3cb5faf10 100644 --- a/.github/workflows/automated-publish-docs.yaml +++ b/.github/workflows/automated-publish-docs.yaml @@ -4,6 +4,8 @@ on: push: branches: - v*.* + paths-ignore: + - 'github/**' jobs: env: @@ -38,7 +40,7 @@ jobs: fi install-dependencies-and-deploy: - name: install dependencies + name: Install Dependencies and Deploy needs: [env] runs-on: ubuntu-latest steps: @@ -91,7 +93,7 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_COLOR: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }} - SLACK_TITLE: "Airgapped package for ${{ inputs.env }} environment ${{ contains(needs.*.result, 'failure') && 'failed' || 'finished successfully' }}" + SLACK_TITLE: "RunAI-Docs: Version ${{ needs.env.outputs.CURRENT_BRANCH }} Deployment ${{ contains(needs.*.result, 'failure') && 'failed' || 'completed successfully' }}" SLACK_MESSAGE_ON_SUCCESS: "Docs were updated successfully for version ${{ needs.env.outputs.TITLE }}" SLACK_MESSAGE_ON_FAILURE: "Docs update FAILED for version ${{ needs.env.outputs.TITLE }}" MSG_MINIMAL: true diff --git a/.github/workflows/delete-deployments.yaml b/.github/workflows/delete-deployments.yaml deleted file mode 100644 index 225a4cf838..0000000000 --- a/.github/workflows/delete-deployments.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: delete docs CI - -on: - workflow_dispatch: - inputs: - delete_version: - required: false - description: 'Delete a version from the site. Use version (vX.Y) from list deployments workflow.' - default: "latest" - type: string - - # pull_request: - # branches: - # - "master" - -jobs: - install_dependencies_and_deploy: - name: install dependencies and deploy latest changes to prod - runs-on: ubuntu-latest - steps: - - name: checkout latest - uses: actions/checkout@v3 - with: - ref: ${{ inputs.version }} - fetch-depth: 0 - - - name: setup python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - cache: 'pip' # caching pip dependencies - - - name: install dependencies - run: | - pip3 install -r requirements.txt - - - name: Configure Git User - run: | - git config user.name "circleci-runai" - git config user.email "circleci-runai@run.ai" -# git fetch origin gh-pages --depth=1 - -# - name: deploy mkdocs latest -# # run: mkdocs gh-deploy --force -# # echo "deploy new version with mike..." -# if: ${{ inputs.version == 'master'}} -# run: | -# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest -# mike set-default ${{ inputs.alias }} --ignore -# - name: deploy mkdocs version -# if: ${{ inputs.version != 'master' }} -# run: | -# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest -# mike set-default ${{ inputs.alias }} --ignore -# if [[ "${{ inputs.delete_latest }}" == 'true' ]]; then -# mike delete --push latest -# fi -# --title=${{ inputs.alias }}${latest} -# run: mike delete --push 2.9a - - - - name: delete deployed version - run: | - mike delete --push ${{ inputs.delete_version }} diff --git a/.github/workflows/mike-delete-all.yaml b/.github/workflows/mike-delete-all.yaml index cbae220f06..c09c924244 100644 --- a/.github/workflows/mike-delete-all.yaml +++ b/.github/workflows/mike-delete-all.yaml @@ -1,76 +1,76 @@ -name: delete all published docs CI +# name: delete all published docs CI -on: - workflow_dispatch: - inputs: - version: - required: false - description: 'Version number from branch to delete' -# default: "main" - type: string - alias: - required: false - description: 'Version or alias. Use a branch version for all docs use the alias to hide docs.' -# default: "latest" - type: string -# title: -# required: false -# description: 'Doc site dropdown menu title (version +/- latest)' -# default: "latest" -# type: string +# on: +# workflow_dispatch: +# inputs: +# version: +# required: false +# description: 'Version number from branch to delete' +# # default: "main" +# type: string +# alias: +# required: false +# description: 'Version or alias. Use a branch version for all docs use the alias to hide docs.' +# # default: "latest" +# type: string +# # title: +# # required: false +# # description: 'Doc site dropdown menu title (version +/- latest)' +# # default: "latest" +# # type: string -# pull_request: -# branches: -# - "master" +# # pull_request: +# # branches: +# # - "master" -jobs: - install_dependencies_and_deploy: - name: install dependencies and deploy latest changes to prod - runs-on: ubuntu-latest - steps: - - name: checkout latest - uses: actions/checkout@v3 - with: - ref: ${{ inputs.version }} - fetch-depth: 0 +# jobs: +# install_dependencies_and_deploy: +# name: install dependencies and deploy latest changes to prod +# runs-on: ubuntu-latest +# steps: +# - name: checkout latest +# uses: actions/checkout@v3 +# with: +# ref: ${{ inputs.version }} +# fetch-depth: 0 - - name: setup python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - cache: 'pip' # caching pip dependencies +# - name: setup python +# uses: actions/setup-python@v4 +# with: +# python-version: '3.9' +# cache: 'pip' # caching pip dependencies - - name: install dependencies - run: | - pip3 install -r requirements.txt - - - name: Configure Git User - run: | - git config user.name "jasonnovichrunai" - git config user.email "jason.novich@run.ai" -# git fetch origin gh-pages --depth=0 +# - name: install dependencies +# run: | +# pip3 install -r requirements.txt -# - name: deploy mkdocs latest -# # run: mkdocs gh-deploy --force -# # echo "deploy new version with mike..." -# if: ${{ inputs.version == 'master'}} -# run: | -# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest -# mike set-default ${{ inputs.alias }} --ignore -# - name: deploy mkdocs version -# if: ${{ inputs.version != 'master' }} +# - name: Configure Git User # run: | -# mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest -# mike set-default ${{ inputs.alias }} --ignore -# if [[ "${{ inputs.delete_latest }}" == 'true' ]]; then -# mike delete --push latest -# fi -# --title=${{ inputs.alias }}${latest} -# run: mike delete --push 2.9a +# git config user.name "jasonnovichrunai" +# git config user.email "jason.novich@run.ai" +# # git fetch origin gh-pages --depth=0 + +# # - name: deploy mkdocs latest +# # # run: mkdocs gh-deploy --force +# # # echo "deploy new version with mike..." +# # if: ${{ inputs.version == 'master'}} +# # run: | +# # mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest +# # mike set-default ${{ inputs.alias }} --ignore +# # - name: deploy mkdocs version +# # if: ${{ inputs.version != 'master' }} +# # run: | +# # mike deploy --push ${{ inputs.version }} ${{ inputs.alias }} --title=${{ inputs.title }}-latest +# # mike set-default ${{ inputs.alias }} --ignore +# # if [[ "${{ inputs.delete_latest }}" == 'true' ]]; then +# # mike delete --push latest +# # fi +# # --title=${{ inputs.alias }}${latest} +# # run: mike delete --push 2.9a -# mike delete --push ${{ inputs.version }} +# # mike delete --push ${{ inputs.version }} - - name: deploy mkdocs - run: | - mike delete --push --all - mike list +# - name: deploy mkdocs +# run: | +# mike delete --push --all +# mike list