From ae7db6bbd2edeb97b2633d8eefa9c24b094d0613 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Wed, 19 Jun 2024 18:23:58 +0300 Subject: [PATCH 01/15] Add Automated-Publish-Docs CI --- .github/workflows/automated-publish-docs.yaml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/automated-publish-docs.yaml diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml new file mode 100644 index 0000000000..f49e957415 --- /dev/null +++ b/.github/workflows/automated-publish-docs.yaml @@ -0,0 +1,99 @@ +name: Haim-Test + +on: + push: + branches: + - v*.* + +jobs: + env: + runs-on: ubuntu-latest + outputs: + CURRENT_BRANCH: ${{ steps.calculate-env.outputs.current_branch }} + NEWEST_VERSION: ${{ steps.calculate-env.outputs.newest_version }} + ALIAS: ${{ steps.calculate-env.outputs.alias }} + TITLE: ${{ steps.calculate-env.outputs.title }} + SLACK_CHANNEL: "docs-review" + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Get all v*.* branches + id: calculate-env + run: | + BRANCHES=$(git branch --list --all | grep -v master | grep 'origin/v*.*' | sed -n -E 's:.*/(v[0-9]+\.[0-9]+).*:\1:p' | sort -Vu) + NEWEST_VERSION=$(printf '%s\n' "${BRANCHES[@]}" | sort -V | tail -n 1) + CURRENT_BRANCH=${GITHUB_REF#refs/heads/} + ALIAS=$CURRENT_BRANCH-alias + TITLE=$(echo $CURRENT_BRANCH | cut -b 2-) + echo current_branch=$CURRENT_BRANCH >> $GITHUB_OUTPUT + echo newest_version=$NEWEST_VERSION >> $GITHUB_OUTPUT + echo alias=$ALIAS >> $GITHUB_OUTPUT + echo title=$TITLE >> $GITHUB_OUTPUT + + if [[ "$CURRENT_BRANCH" == "$NEWEST_VERSION" ]]; then + echo "Deploying $NEWEST_VERSION as latest..." + else + echo "Deploying $CURRENT_BRANCH which is not the latest version ( => $NEWEST_VERSION )..." + fi + + install-dependencies: + name: install dependencies + needs: [env] + runs-on: ubuntu-latest + steps: + - name: checkout latest + uses: actions/checkout@v4 + with: + ref: ${{ needs.env.outputs.CURRENT_BRANCH }} + fetch-depth: 0 + + - name: setup python + uses: actions/setup-python@v5 + 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" + + deploy: + name: deploy mkdocs + needs: [env, install-dependencies] + runs-on: ubuntu-latest + steps: + - name: deploy mkdocs latest + run: | + if [[ "${{ needs.env.outputs.CURRENT_BRANCH }}" == "${{ needs.env.outputs.NEWEST_VERSION }}" ]]; then + mike list + mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} + mike set-default ${{ needs.env.outputs.ALIAS }} --push latest + mike list + else + mike list + mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} + mike list + fi + + slack-notification: + name: Slack Notification + needs: [env, install-dependencies, deploy] + if: always() + runs-on: ubuntu-latest + steps: + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + 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_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 + SLACK_FOOTER: "" From d5cbbdbce5d5b57777ee5119b54ae77bac8d9c0b Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Wed, 19 Jun 2024 18:26:18 +0300 Subject: [PATCH 02/15] Add Automated-Publish-Docs CI --- .github/workflows/automated-publish-docs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index f49e957415..268f11d444 100644 --- a/.github/workflows/automated-publish-docs.yaml +++ b/.github/workflows/automated-publish-docs.yaml @@ -1,4 +1,4 @@ -name: Haim-Test +name: Automated-Publish-Docs on: push: @@ -80,7 +80,7 @@ jobs: mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} mike list fi - + slack-notification: name: Slack Notification needs: [env, install-dependencies, deploy] From 9b66e47f3d68f66675378a59a359ef255f7cc451 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Wed, 19 Jun 2024 18:29:24 +0300 Subject: [PATCH 03/15] Add Automated-Publish-Docs CI --- .github/workflows/automated-publish-docs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index 268f11d444..617f789c68 100644 --- a/.github/workflows/automated-publish-docs.yaml +++ b/.github/workflows/automated-publish-docs.yaml @@ -72,11 +72,13 @@ jobs: run: | if [[ "${{ needs.env.outputs.CURRENT_BRANCH }}" == "${{ needs.env.outputs.NEWEST_VERSION }}" ]]; then mike list + git fetch origin gh-pages --depth=1 mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} mike set-default ${{ needs.env.outputs.ALIAS }} --push latest mike list else mike list + git fetch origin gh-pages --depth=1 mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} mike list fi From 548200880142de915ee02325914ef7c3b4b4eb64 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 23 Jun 2024 12:23:06 +0300 Subject: [PATCH 04/15] Add Automated-Publish-Docs CI --- .github/workflows/automated-publish-docs.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index 617f789c68..508c881f63 100644 --- a/.github/workflows/automated-publish-docs.yaml +++ b/.github/workflows/automated-publish-docs.yaml @@ -71,12 +71,15 @@ jobs: - name: deploy mkdocs latest run: | if [[ "${{ needs.env.outputs.CURRENT_BRANCH }}" == "${{ needs.env.outputs.NEWEST_VERSION }}" ]]; then + echo "Deploying ${{ needs.env.outputs.NEWEST_VERSION }} as latest..." mike list git fetch origin gh-pages --depth=1 - mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} + ### REMOVE "LATEST" FROM CURRENT VERSION ON THIS LINE ### + mike deploy --push --update-aliases ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} latest --title=${{ needs.env.outputs.TITLE }} mike set-default ${{ needs.env.outputs.ALIAS }} --push latest mike list else + echo "Deploying ${{ needs.env.outputs.CURRENT_BRANCH }} which is not the latest version ( => ${{ needs.env.outputs.NEWEST_VERSION }} )..." mike list git fetch origin gh-pages --depth=1 mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} From 0476c96110220c0765d5e9d3cc25dc3a3d0ee57a Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 23 Jun 2024 15:33:09 +0300 Subject: [PATCH 05/15] Add Automated-Publish-Docs CI --- .github/workflows/automated-publish-docs.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index 508c881f63..f64da1ccdb 100644 --- a/.github/workflows/automated-publish-docs.yaml +++ b/.github/workflows/automated-publish-docs.yaml @@ -74,15 +74,14 @@ jobs: echo "Deploying ${{ needs.env.outputs.NEWEST_VERSION }} as latest..." mike list git fetch origin gh-pages --depth=1 - ### REMOVE "LATEST" FROM CURRENT VERSION ON THIS LINE ### - mike deploy --push --update-aliases ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} latest --title=${{ needs.env.outputs.TITLE }} - mike set-default ${{ needs.env.outputs.ALIAS }} --push latest + mike deploy ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} latest --title=${{ needs.env.outputs.TITLE }} --push --update-aliases + mike set-default latest --push mike list else echo "Deploying ${{ needs.env.outputs.CURRENT_BRANCH }} which is not the latest version ( => ${{ needs.env.outputs.NEWEST_VERSION }} )..." mike list git fetch origin gh-pages --depth=1 - mike deploy --push ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} + mike deploy ${{ needs.env.outputs.CURRENT_BRANCH }} ${{ needs.env.outputs.ALIAS }} --title=${{ needs.env.outputs.TITLE }} --push mike list fi From 6416bcdf7a62a2a81d13d9b5f6a6144e10c7ae95 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 30 Jun 2024 01:12:13 +0300 Subject: [PATCH 06/15] Add Preview Docs on PR --- .github/workflows/ci.yml.old | 30 ---------- .github/workflows/create-preview-on-pr.yaml | 61 +++++++++++++++++++++ .github/workflows/preview-prs.yaml | 29 ++++++++++ 3 files changed, 90 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/ci.yml.old create mode 100644 .github/workflows/create-preview-on-pr.yaml create mode 100644 .github/workflows/preview-prs.yaml diff --git a/.github/workflows/ci.yml.old b/.github/workflows/ci.yml.old deleted file mode 100644 index d2df9fef92..0000000000 --- a/.github/workflows/ci.yml.old +++ /dev/null @@ -1,30 +0,0 @@ -name: ci -on: - push: - branches: - - 'v*.*' - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: action checkout - uses: actions/checkout@v3 - - name: Python step - uses: actions/setup-python@v4 - with: - python-version: 3.x - - name: Cache setup - uses: actions/cache@v2 - with: - key: ${{ github.ref }} - path: .cache - - name: install requirements - run: pip3 install -r requirements.txt - # run: mkdocs gh-deploy --force - - name: Deploy using mike - run: mike deploy --push ${{ steps.extract_branch.outputs.branch }} diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml new file mode 100644 index 0000000000..cb76735723 --- /dev/null +++ b/.github/workflows/create-preview-on-pr.yaml @@ -0,0 +1,61 @@ +# name: Create Preview for PRs + +# on: +# pull_request: +# branches: +# - master +# - v*.* + +# env: +# PR_NUMBER: ${{ github.event.number }} + +# jobs: +# comment-on-pr: +# runs-on: ubuntu-latest +# steps: +# - name: Comment on PR +# uses: hasura/comment-progress@v2.2.0 +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# repository: ${{ github.repository }} +# number: ${{ github.event.number }} +# id: deploy-preview +# message: "Starting deployment of preview ā³..." + +# create-preview: +# name: create preview +# runs-on: ubuntu-latest +# steps: +# - name: checkout latest +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 + +# - name: setup python +# uses: actions/setup-python@v5 +# 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" + +# - name: building preview +# run: | +# mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true + +# - name: Update comment +# uses: hasura/comment-progress@v2.2.0 +# if: github.ref != 'refs/heads/main' +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# repository: ${{ github.repository }} +# number: ${{ github.event.number }} +# id: deploy-preview +# message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file diff --git a/.github/workflows/preview-prs.yaml b/.github/workflows/preview-prs.yaml new file mode 100644 index 0000000000..6410051647 --- /dev/null +++ b/.github/workflows/preview-prs.yaml @@ -0,0 +1,29 @@ +name: Deploy PR previews + +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + deploy-preview: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install and Build + if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed + run: | + npm install + npm run build + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./site/ \ No newline at end of file From 2ffc3dbd5d5f3e5d66b05020587872e4caecbcd1 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 30 Jun 2024 01:27:20 +0300 Subject: [PATCH 07/15] Add Preview Docs on PR --- .github/workflows/create-preview-on-pr.yaml | 104 ++++++++++---------- .github/workflows/preview-prs.yaml | 29 ------ 2 files changed, 52 insertions(+), 81 deletions(-) delete mode 100644 .github/workflows/preview-prs.yaml diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml index cb76735723..093725f806 100644 --- a/.github/workflows/create-preview-on-pr.yaml +++ b/.github/workflows/create-preview-on-pr.yaml @@ -1,61 +1,61 @@ -# name: Create Preview for PRs +name: Create Preview for PRs -# on: -# pull_request: -# branches: -# - master -# - v*.* +on: + pull_request: + branches: + - master + - v*.* -# env: -# PR_NUMBER: ${{ github.event.number }} +env: + PR_NUMBER: ${{ github.event.number }} -# jobs: -# comment-on-pr: -# runs-on: ubuntu-latest -# steps: -# - name: Comment on PR -# uses: hasura/comment-progress@v2.2.0 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# repository: ${{ github.repository }} -# number: ${{ github.event.number }} -# id: deploy-preview -# message: "Starting deployment of preview ā³..." +jobs: + comment-on-pr: + runs-on: ubuntu-latest + steps: + - name: Comment on PR + uses: hasura/comment-progress@v2.2.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} + id: deploy-preview + message: "Starting deployment of preview ā³..." -# create-preview: -# name: create preview -# runs-on: ubuntu-latest -# steps: -# - name: checkout latest -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 + create-preview: + name: create preview + runs-on: ubuntu-latest + steps: + - name: checkout latest + uses: actions/checkout@v4 + with: + fetch-depth: 0 -# - name: setup python -# uses: actions/setup-python@v5 -# with: -# python-version: '3.9' -# cache: 'pip' # caching pip dependencies + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + cache: 'pip' # caching pip dependencies -# - name: install dependencies -# run: | -# pip3 install -r requirements.txt + - 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" + - name: Configure Git User + run: | + git config user.name "circleci-runai" + git config user.email "circleci-runai@run.ai" -# - name: building preview -# run: | -# mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true + - name: building preview + run: | + mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true -# - name: Update comment -# uses: hasura/comment-progress@v2.2.0 -# if: github.ref != 'refs/heads/main' -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# repository: ${{ github.repository }} -# number: ${{ github.event.number }} -# id: deploy-preview -# message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file + - name: Update comment + uses: hasura/comment-progress@v2.2.0 + if: github.ref != 'refs/heads/main' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} + id: deploy-preview + message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file diff --git a/.github/workflows/preview-prs.yaml b/.github/workflows/preview-prs.yaml deleted file mode 100644 index 6410051647..0000000000 --- a/.github/workflows/preview-prs.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: Deploy PR previews - -on: - pull_request: - types: - - opened - - reopened - - synchronize - - closed - -concurrency: preview-${{ github.ref }} - -jobs: - deploy-preview: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install and Build - if: github.event.action != 'closed' # You might want to skip the build if the PR has been closed - run: | - npm install - npm run build - - - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 - with: - source-dir: ./site/ \ No newline at end of file From 0b3915fdf83427d62cf9c3ff5d3ebe45483c9ad2 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 30 Jun 2024 01:28:08 +0300 Subject: [PATCH 08/15] Add Preview Docs on PR --- .github/workflows/create-preview-on-pr.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml index 093725f806..ee346c451b 100644 --- a/.github/workflows/create-preview-on-pr.yaml +++ b/.github/workflows/create-preview-on-pr.yaml @@ -2,6 +2,11 @@ name: Create Preview for PRs on: pull_request: + types: + - opened + - reopened + - synchronize + - closed branches: - master - v*.* From fdd2600ea9c5628b461828d7e91128fdaff22cab Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 30 Jun 2024 14:34:56 +0300 Subject: [PATCH 09/15] Add Preview Docs on PR --- .github/workflows/create-preview-on-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml index ee346c451b..e9e8967e26 100644 --- a/.github/workflows/create-preview-on-pr.yaml +++ b/.github/workflows/create-preview-on-pr.yaml @@ -53,7 +53,7 @@ jobs: - name: building preview run: | - mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true + mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push - name: Update comment uses: hasura/comment-progress@v2.2.0 From e00bc99f16976d178127802284d33b84f88b6116 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Sun, 30 Jun 2024 14:40:53 +0300 Subject: [PATCH 10/15] Add Preview Docs on PR --- .github/workflows/create-preview-on-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml index e9e8967e26..286490b2dc 100644 --- a/.github/workflows/create-preview-on-pr.yaml +++ b/.github/workflows/create-preview-on-pr.yaml @@ -63,4 +63,4 @@ jobs: repository: ${{ github.repository }} number: ${{ github.event.number }} id: deploy-preview - message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file + message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ https://docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file From 026f91a8dad7dad04bbf20394133a2875122f904 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Wed, 3 Jul 2024 22:11:02 +0300 Subject: [PATCH 11/15] Disable Preview Docs on PR --- .github/workflows/create-preview-on-pr.yaml | 113 ++++++++++---------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml index 286490b2dc..95daaf2938 100644 --- a/.github/workflows/create-preview-on-pr.yaml +++ b/.github/workflows/create-preview-on-pr.yaml @@ -1,66 +1,65 @@ -name: Create Preview for PRs +# name: Create Preview for PRs -on: - pull_request: - types: - - opened - - reopened - - synchronize - - closed - branches: - - master - - v*.* +# on: +# pull_request: +# types: +# - opened +# - reopened +# - synchronize +# - closed +# branches: +# - master +# - v*.* -env: - PR_NUMBER: ${{ github.event.number }} +# env: +# PR_NUMBER: ${{ github.event.number }} -jobs: - comment-on-pr: - runs-on: ubuntu-latest - steps: - - name: Comment on PR - uses: hasura/comment-progress@v2.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - number: ${{ github.event.number }} - id: deploy-preview - message: "Starting deployment of preview ā³..." +# jobs: +# comment-on-pr: +# runs-on: ubuntu-latest +# steps: +# - name: Comment on PR +# uses: hasura/comment-progress@v2.2.0 +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# repository: ${{ github.repository }} +# number: ${{ github.event.number }} +# id: deploy-preview +# message: "Starting deployment of preview ā³..." - create-preview: - name: create preview - runs-on: ubuntu-latest - steps: - - name: checkout latest - uses: actions/checkout@v4 - with: - fetch-depth: 0 +# create-preview: +# name: create preview +# runs-on: ubuntu-latest +# steps: +# - name: checkout latest +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - cache: 'pip' # caching pip dependencies +# - name: setup python +# uses: actions/setup-python@v5 +# with: +# python-version: '3.9' +# cache: 'pip' # caching pip dependencies - - name: install dependencies - run: | - pip3 install -r requirements.txt +# - 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" +# - name: Configure Git User +# run: | +# git config user.name "circleci-runai" +# git config user.email "circleci-runai@run.ai" - - name: building preview - run: | - mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push +# - name: building preview +# run: | +# mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push - - name: Update comment - uses: hasura/comment-progress@v2.2.0 - if: github.ref != 'refs/heads/main' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - number: ${{ github.event.number }} - id: deploy-preview - message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ https://docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file +# - name: Update comment +# uses: hasura/comment-progress@v2.2.0 +# with: +# github-token: ${{ secrets.GITHUB_TOKEN }} +# repository: ${{ github.repository }} +# number: ${{ github.event.number }} +# id: deploy-preview +# message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ https://docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file From 5f281a1a171e68992778d919e8a5efae296a2d90 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Tue, 9 Jul 2024 15:52:44 +0300 Subject: [PATCH 12/15] Add Smart Previews PR mechanism --- .github/workflows/automated-publish-docs.yaml | 19 ++- .../workflows/create-preview-on-pr-v2.yaml | 110 ++++++++++++++++++ .../workflows/create-preview-on-pr-v3.yaml | 87 ++++++++++++++ .github/workflows/deploy-staging.yaml | 2 +- 4 files changed, 206 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/create-preview-on-pr-v2.yaml create mode 100644 .github/workflows/create-preview-on-pr-v3.yaml diff --git a/.github/workflows/automated-publish-docs.yaml b/.github/workflows/automated-publish-docs.yaml index f64da1ccdb..97c38ef47d 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: @@ -37,8 +39,8 @@ jobs: echo "Deploying $CURRENT_BRANCH which is not the latest version ( => $NEWEST_VERSION )..." fi - install-dependencies: - name: install dependencies + install-dependencies-and-deploy: + name: Install Dependencies and Deploy needs: [env] runs-on: ubuntu-latest steps: @@ -63,12 +65,7 @@ jobs: git config user.name "circleci-runai" git config user.email "circleci-runai@run.ai" - deploy: - name: deploy mkdocs - needs: [env, install-dependencies] - runs-on: ubuntu-latest - steps: - - name: deploy mkdocs latest + - name: deploy mkdocs run: | if [[ "${{ needs.env.outputs.CURRENT_BRANCH }}" == "${{ needs.env.outputs.NEWEST_VERSION }}" ]]; then echo "Deploying ${{ needs.env.outputs.NEWEST_VERSION }} as latest..." @@ -87,7 +84,7 @@ jobs: slack-notification: name: Slack Notification - needs: [env, install-dependencies, deploy] + needs: [env, install-dependencies-and-deploy] if: always() runs-on: ubuntu-latest steps: @@ -96,8 +93,8 @@ 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 - SLACK_FOOTER: "" + SLACK_FOOTER: "" \ No newline at end of file diff --git a/.github/workflows/create-preview-on-pr-v2.yaml b/.github/workflows/create-preview-on-pr-v2.yaml new file mode 100644 index 0000000000..7a9d7e5ead --- /dev/null +++ b/.github/workflows/create-preview-on-pr-v2.yaml @@ -0,0 +1,110 @@ +# name: Create Preview Env using S3 and CloudFront + +# on: +# pull_request: +# types: +# - opened +# - reopened +# - synchronize +# - closed +# branches: +# - master +# - v*.* +# env: +# PR_NUMBER: ${{ github.event.number }} + +# jobs: +# deploy: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 + +# - name: Install AWS CLI +# run: | +# sudo apt-get update +# sudo apt-get install awscli -y + +# - name: Sync S3 bucket +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws s3 sync ./docs s3://your-bucket-name + +# - name: Invalidate CloudFront cache +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" + +# preview: +# runs-on: ubuntu-latest +# if: github.event_name == 'pull_request' +# steps: +# - name: Checkout code +# uses: actions/checkout@v2 + +# - name: Install AWS CLI +# run: | +# sudo apt-get update +# sudo apt-get install awscli -y + +# - name: Sync S3 bucket for preview +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws s3 sync ./docs s3://your-bucket-name/${{ env.PR_NUMBER }} + +# - name: Invalidate CloudFront cache +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/${{ env.PR_NUMBER }}/*" + +# - name: Output preview URL +# run: | +# echo "Preview environment URL: https://your-cloudfront-domain/${{ env.PR_NUMBER }}/" + +# - name: Comment on PR with preview URL +# uses: actions/github-script@v6 +# with: +# script: | +# github.rest.issues.createComment({ +# issue_number: context.issue.number, +# owner: context.repo.owner, +# repo: context.repo.repo, +# body: `Preview environment URL: https://your-cloudfront-domain/${{ env.PR_NUMBER }}/` +# }) + +# cleanup: +# runs-on: ubuntu-latest +# if: github.event_name == 'pull_request' && github.event.action == 'closed' +# steps: +# - name: Install AWS CLI +# run: | +# sudo apt-get update +# sudo apt-get install awscli -y + +# - name: Remove PR directory from S3 bucket +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws s3 rm s3://your-bucket-name/pr-${{ env.PR_NUMBER }} --recursive + +# - name: Invalidate CloudFront cache +# env: +# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} +# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} +# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} +# run: | +# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ env.PR_NUMBER }}/*" diff --git a/.github/workflows/create-preview-on-pr-v3.yaml b/.github/workflows/create-preview-on-pr-v3.yaml new file mode 100644 index 0000000000..2c3f955e65 --- /dev/null +++ b/.github/workflows/create-preview-on-pr-v3.yaml @@ -0,0 +1,87 @@ +name: Create Preview Environment + +on: + pull_request: + types: [opened, reopened, synchronize, closed] + branches: + - master + - v*.* + +jobs: + build-and-deploy: + if: github.event.action != 'closed' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + cache: 'pip' # caching pip dependencies + + - name: install dependencies + run: | + pip3 install -r requirements.txt + + - name: mkdocs-build-action + run: | + mkdocs build + + - name: Install AWS CLI + run: | + sudo apt-get update + sudo apt-get install awscli -y + + - name: Sync S3 bucket for preview + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + aws s3 sync ./site/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/PR-${{ github.event.number }} --delete + + - name: Invalidate CloudFront cache + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/PR-${{ github.event.number }}/*" + + - name: Comment on PR with preview URL + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Preview environment URL: https://your-cloudfront-domain/PR-${{ github.event.number }}/` + }) + + cleanup: + if: github.event.action == 'closed' + runs-on: ubuntu-latest + steps: + - name: Install AWS CLI + run: | + sudo apt-get update + sudo apt-get install awscli -y + + - name: Remove PR directory from S3 bucket + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + aws s3 rm s3://${{ secrets.AWS_S3_BUCKET_NAME }}/PR-${{ github.event.number }} --recursive + + - name: Invalidate CloudFront cache + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + run: | + aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/PR-${{ github.event.number }}/*" diff --git a/.github/workflows/deploy-staging.yaml b/.github/workflows/deploy-staging.yaml index 4fadb8dbfe..feacb391d5 100644 --- a/.github/workflows/deploy-staging.yaml +++ b/.github/workflows/deploy-staging.yaml @@ -41,7 +41,7 @@ jobs: with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + aws-region: ${{ secrets.AWS_DEFAULT_REGION}} - name: Sync output to S3 run: | From 81a40d214f459d34674d15dcb027daecaf16457d Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Tue, 9 Jul 2024 18:58:26 +0300 Subject: [PATCH 13/15] Add Smart Previews PR mechanism --- .github/workflows/create-preview-on-pr-v3.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-preview-on-pr-v3.yaml b/.github/workflows/create-preview-on-pr-v3.yaml index 2c3f955e65..212bb59492 100644 --- a/.github/workflows/create-preview-on-pr-v3.yaml +++ b/.github/workflows/create-preview-on-pr-v3.yaml @@ -58,7 +58,7 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: `Preview environment URL: https://your-cloudfront-domain/PR-${{ github.event.number }}/` + body: `Preview environment URL: https://d161wck8lc3ih2.cloudfront.net/PR-${{ github.event.number }}/` }) cleanup: @@ -78,10 +78,10 @@ jobs: run: | aws s3 rm s3://${{ secrets.AWS_S3_BUCKET_NAME }}/PR-${{ github.event.number }} --recursive - - name: Invalidate CloudFront cache - env: - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - run: | - aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/PR-${{ github.event.number }}/*" + # - name: Invalidate CloudFront cache + # env: + # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + # AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + # run: | + # aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/PR-${{ github.event.number }}/*" From 3b078db01319d74c9bb761fe19d3d7da0ed3a050 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Tue, 9 Jul 2024 20:09:14 +0300 Subject: [PATCH 14/15] Add Smart Previews PR mechanism --- ...-v3.yaml => create-preview-env-on-pr.yaml} | 2 +- .../workflows/create-preview-on-pr-v2.yaml | 110 ------------------ .github/workflows/create-preview-on-pr.yaml | 65 ----------- 3 files changed, 1 insertion(+), 176 deletions(-) rename .github/workflows/{create-preview-on-pr-v3.yaml => create-preview-env-on-pr.yaml} (98%) delete mode 100644 .github/workflows/create-preview-on-pr-v2.yaml delete mode 100644 .github/workflows/create-preview-on-pr.yaml diff --git a/.github/workflows/create-preview-on-pr-v3.yaml b/.github/workflows/create-preview-env-on-pr.yaml similarity index 98% rename from .github/workflows/create-preview-on-pr-v3.yaml rename to .github/workflows/create-preview-env-on-pr.yaml index 212bb59492..86343216eb 100644 --- a/.github/workflows/create-preview-on-pr-v3.yaml +++ b/.github/workflows/create-preview-env-on-pr.yaml @@ -1,4 +1,4 @@ -name: Create Preview Environment +name: Create Preview Environment on PR on: pull_request: diff --git a/.github/workflows/create-preview-on-pr-v2.yaml b/.github/workflows/create-preview-on-pr-v2.yaml deleted file mode 100644 index 7a9d7e5ead..0000000000 --- a/.github/workflows/create-preview-on-pr-v2.yaml +++ /dev/null @@ -1,110 +0,0 @@ -# name: Create Preview Env using S3 and CloudFront - -# on: -# pull_request: -# types: -# - opened -# - reopened -# - synchronize -# - closed -# branches: -# - master -# - v*.* -# env: -# PR_NUMBER: ${{ github.event.number }} - -# jobs: -# deploy: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 - -# - name: Install AWS CLI -# run: | -# sudo apt-get update -# sudo apt-get install awscli -y - -# - name: Sync S3 bucket -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws s3 sync ./docs s3://your-bucket-name - -# - name: Invalidate CloudFront cache -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" - -# preview: -# runs-on: ubuntu-latest -# if: github.event_name == 'pull_request' -# steps: -# - name: Checkout code -# uses: actions/checkout@v2 - -# - name: Install AWS CLI -# run: | -# sudo apt-get update -# sudo apt-get install awscli -y - -# - name: Sync S3 bucket for preview -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws s3 sync ./docs s3://your-bucket-name/${{ env.PR_NUMBER }} - -# - name: Invalidate CloudFront cache -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/${{ env.PR_NUMBER }}/*" - -# - name: Output preview URL -# run: | -# echo "Preview environment URL: https://your-cloudfront-domain/${{ env.PR_NUMBER }}/" - -# - name: Comment on PR with preview URL -# uses: actions/github-script@v6 -# with: -# script: | -# github.rest.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: `Preview environment URL: https://your-cloudfront-domain/${{ env.PR_NUMBER }}/` -# }) - -# cleanup: -# runs-on: ubuntu-latest -# if: github.event_name == 'pull_request' && github.event.action == 'closed' -# steps: -# - name: Install AWS CLI -# run: | -# sudo apt-get update -# sudo apt-get install awscli -y - -# - name: Remove PR directory from S3 bucket -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws s3 rm s3://your-bucket-name/pr-${{ env.PR_NUMBER }} --recursive - -# - name: Invalidate CloudFront cache -# env: -# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} -# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} -# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} -# run: | -# aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/pr-${{ env.PR_NUMBER }}/*" diff --git a/.github/workflows/create-preview-on-pr.yaml b/.github/workflows/create-preview-on-pr.yaml deleted file mode 100644 index 95daaf2938..0000000000 --- a/.github/workflows/create-preview-on-pr.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# name: Create Preview for PRs - -# on: -# pull_request: -# types: -# - opened -# - reopened -# - synchronize -# - closed -# branches: -# - master -# - v*.* - -# env: -# PR_NUMBER: ${{ github.event.number }} - -# jobs: -# comment-on-pr: -# runs-on: ubuntu-latest -# steps: -# - name: Comment on PR -# uses: hasura/comment-progress@v2.2.0 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# repository: ${{ github.repository }} -# number: ${{ github.event.number }} -# id: deploy-preview -# message: "Starting deployment of preview ā³..." - -# create-preview: -# name: create preview -# runs-on: ubuntu-latest -# steps: -# - name: checkout latest -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 - -# - name: setup python -# uses: actions/setup-python@v5 -# 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" - -# - name: building preview -# run: | -# mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push - -# - name: Update comment -# uses: hasura/comment-progress@v2.2.0 -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} -# repository: ${{ github.repository }} -# number: ${{ github.event.number }} -# id: deploy-preview -# message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n āœØ https://docs.run.ai/${{ env.PR_NUMBER }} āœØ\n\nšŸš€ Happy reviewing! šŸš€" \ No newline at end of file From c06cd4cf50c3c0dba84fffa177ce2b50a85ffec8 Mon Sep 17 00:00:00 2001 From: haimlevy2006 Date: Wed, 10 Jul 2024 11:11:33 +0300 Subject: [PATCH 15/15] Add Smart Previews PR mechanism --- .github/workflows/create-preview-env-on-pr.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/create-preview-env-on-pr.yaml b/.github/workflows/create-preview-env-on-pr.yaml index 86343216eb..445e6ffbca 100644 --- a/.github/workflows/create-preview-env-on-pr.yaml +++ b/.github/workflows/create-preview-env-on-pr.yaml @@ -77,11 +77,3 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} run: | aws s3 rm s3://${{ secrets.AWS_S3_BUCKET_NAME }}/PR-${{ github.event.number }} --recursive - - # - name: Invalidate CloudFront cache - # env: - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} - # run: | - # aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/PR-${{ github.event.number }}/*"