From 46ce875cd2c578ce528353e1bd60469335b6eb87 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 19:40:09 -0500 Subject: [PATCH 01/18] remove peaceiris --- action.yml | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/action.yml b/action.yml index 2fa2123..7af253f 100644 --- a/action.yml +++ b/action.yml @@ -7,10 +7,6 @@ branding: color: yellow inputs: - github_token: - description: "Set a GitHub token to authenticate deployment. This is autogenerated by the action." - required: false - default: ${{ github.token }} project_path: description: "Set your Kedro-project path to build the Kedro-Viz artifacts." required: false @@ -23,30 +19,6 @@ inputs: description: "Set your consent if you would like to participate in Kedro-Telemetry. Defaults to false" required: false default: false - publishing_source: - description: "Set a publishing source for GitHub pages. Defaults to branch" - required: false - default: "branch" - publish_branch: - description: "Set a GitHub pages publish branch. Defaults to gh-pages" - required: false - default: "gh-pages" - commit_message: - description: "Set a commit message for the deployment. Defaults to your original commit message." - required: false - default: ${{ github.event.head_commit.message }} - force_orphan: - description: "Set an option to publish branch with only the latest commit. Defaults to true" - required: false - default: true - user_name: - description: "Set git config user.name. Defaults to github-actions[bot]" - required: false - default: "github-actions[bot]" - user_email: - description: "Set git config user.email. Defaults to github-actions[bot]@users.noreply.github.com" - required: false - default: "github-actions[bot]@users.noreply.github.com" runs: using: "composite" @@ -75,23 +47,10 @@ runs: if !(kedro viz build ${{ env.build_flags }} |& tee /dev/stderr | grep -i -q "Success!"); then exit 1 fi - shell: bash - - name: Deploy to GitHub Pages with publish branch as source - if: ${{ inputs.publishing_source == 'branch' }} - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ inputs.github_token }} - publish_branch: ${{ inputs.publish_branch }} - publish_dir: "${{ inputs.project_path }}/build" - user_name: ${{ inputs.user_name }} - user_email: ${{ inputs.user_email }} - commit_message: ${{ inputs.commit_message }} - force_orphan: ${{ inputs.force_orphan }} + shell: bash - name: Upload GitHub Pages artifact - if: ${{ inputs.publishing_source == 'workflow' }} uses: actions/upload-pages-artifact@v3 with: path: "${{ inputs.project_path }}/build" - name: Deploy to GitHub Pages - if: ${{ inputs.publishing_source == 'workflow' }} uses: actions/deploy-pages@v4 From 57b1a593f57efe4cb885ac3ee6aada8b1885e909 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 19:58:17 -0500 Subject: [PATCH 02/18] testing upload action --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e10aa8..1723de5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,8 @@ on: jobs: test: runs-on: ubuntu-latest + environment: + name: github-pages steps: - name: Fetch the repository uses: actions/checkout@v4 From 5fbaa6e2877f04e3c917f1e6b903a4fab72e923c Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 20:02:37 -0500 Subject: [PATCH 03/18] revert env --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1723de5..1e10aa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,8 +21,6 @@ on: jobs: test: runs-on: ubuntu-latest - environment: - name: github-pages steps: - name: Fetch the repository uses: actions/checkout@v4 From 79252f8318e3916d68d5775b8720ce890ba97795 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 20:39:00 -0500 Subject: [PATCH 04/18] fixing duplicate artifact issue --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 7af253f..3470f0a 100644 --- a/action.yml +++ b/action.yml @@ -51,6 +51,10 @@ runs: - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: + name: github-pages-${{ github.sha }} path: "${{ inputs.project_path }}/build" - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 + with: + artifact_name: github-pages-${{ github.sha }} + From 9fd9388123f762a3c833c4c3c967ddd968bb8132 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 20:45:06 -0500 Subject: [PATCH 05/18] fixing duplicate artifact issue --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 3470f0a..e3d0ef5 100644 --- a/action.yml +++ b/action.yml @@ -56,5 +56,6 @@ runs: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: + token: ${{ secrets.GITHUB_TOKEN }} artifact_name: github-pages-${{ github.sha }} From bc001cfbd8094130c1dfbcd7b8ec69ec4c2859f0 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 21:09:01 -0500 Subject: [PATCH 06/18] fixing duplicate artifact issue --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e3d0ef5..460c3f3 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,6 @@ runs: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ github.token }} artifact_name: github-pages-${{ github.sha }} From 26d3c28d188f6a134d1da4dc4f609eda077f2bdb Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 21:15:20 -0500 Subject: [PATCH 07/18] fixing duplicate artifact issue --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e10aa8..8d9f8fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,8 @@ on: jobs: test: runs-on: ubuntu-latest + environment: + name: github-pages steps: - name: Fetch the repository uses: actions/checkout@v4 From aeef04dd648938e0a746f945f1ff8f02c2452e73 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 21:33:37 -0500 Subject: [PATCH 08/18] fixing duplicate artifact issue --- action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/action.yml b/action.yml index 460c3f3..3588011 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,4 @@ runs: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: - token: ${{ github.token }} artifact_name: github-pages-${{ github.sha }} - From 88c07505f1a91b231903d27d71d10cd68b9ebae2 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 21:45:21 -0500 Subject: [PATCH 09/18] fixing duplicate artifact issue --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 3588011..3752d15 100644 --- a/action.yml +++ b/action.yml @@ -56,4 +56,5 @@ runs: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: + token: ${{ github.token }} artifact_name: github-pages-${{ github.sha }} From 43e8f27c5d8e836b9c8b1a04f779d5988e6fac3c Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Wed, 24 Jul 2024 23:58:19 -0500 Subject: [PATCH 10/18] testing setup and deploy --- .github/workflows/test.yml | 2 -- action.yml | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d9f8fc..1e10aa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,8 +21,6 @@ on: jobs: test: runs-on: ubuntu-latest - environment: - name: github-pages steps: - name: Fetch the repository uses: actions/checkout@v4 diff --git a/action.yml b/action.yml index 3752d15..b988cf9 100644 --- a/action.yml +++ b/action.yml @@ -47,7 +47,9 @@ runs: if !(kedro viz build ${{ env.build_flags }} |& tee /dev/stderr | grep -i -q "Success!"); then exit 1 fi - shell: bash + shell: bash + - name: Setup Pages + uses: actions/configure-pages@v5 - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: @@ -56,5 +58,4 @@ runs: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: - token: ${{ github.token }} artifact_name: github-pages-${{ github.sha }} From 87493a6212c4822ec47912294090b0c61c759a49 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Thu, 25 Jul 2024 00:02:52 -0500 Subject: [PATCH 11/18] keep it simple with workflow --- action.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/action.yml b/action.yml index b988cf9..72933f0 100644 --- a/action.yml +++ b/action.yml @@ -48,8 +48,6 @@ runs: exit 1 fi shell: bash - - name: Setup Pages - uses: actions/configure-pages@v5 - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: From bf334d2c1bd7c8c425aead90f6790b2b25fbbf1a Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Thu, 25 Jul 2024 00:09:09 -0500 Subject: [PATCH 12/18] resolving duplicate artifacts issue --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 72933f0..a3c0187 100644 --- a/action.yml +++ b/action.yml @@ -51,9 +51,9 @@ runs: - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: - name: github-pages-${{ github.sha }} + name: github-pages-${{ github.run_id }}-${{ github.run_number }} path: "${{ inputs.project_path }}/build" - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: - artifact_name: github-pages-${{ github.sha }} + artifact_name: github-pages-${{ github.run_id }}-${{ github.run_number }} From 9b554c32644e82c9cd83606c8699ae123bd45ddc Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Thu, 25 Jul 2024 12:51:03 -0500 Subject: [PATCH 13/18] update readme and release docs --- README.md | 132 +++++++++++++++++++++++++++++++---------------------- RELEASE.md | 7 +++ 2 files changed, 85 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 3fb7768..a4d914b 100644 --- a/README.md +++ b/README.md @@ -40,62 +40,86 @@ This action helps in the automation of a deployment strategy mentioned in [platf - **Kedro-project dependencies:** Install all the Kedro-project dependencies before using this action in your workflow. - **Python-version:** You need to have an environment with `python>=3.9` in your workflow. -**NOTE:** While configuring your repository for GitHub Pages, you have two publishing source options. You can either choose a branch or a custom GitHub Actions workflow. If you choose a branch, the build artifacts will be uploaded to the `publish_branch` you pass as an input to the action, which defaults to `gh-pages`. If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action. In this case, no branch will be created and the artifacts are deployed at run-time. Please find more information on configuring a publishing source for github pages site in the [official docs](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). +**NOTE:** While configuring your repository for GitHub Pages, you have two publishing source options. You can either choose a branch or a custom GitHub Actions workflow (recommended). If you choose a branch, the build artifacts will be uploaded to the `publish_branch` you pass as an input to the action, which defaults to `gh-pages`. If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action (this is made as default from v2). In this case, no branch will be created and the artifacts are deployed at run-time. Please find more information on configuring a publishing source for github pages site in the [official docs](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). ## Usage -```yaml - -- uses: kedro-org/publish-kedro-viz@v1 - with: - # The GitHub token to authenticate deployment. This is autogenerated by the action. - # Default: ${{ github.token }} - github_token: '' - - # The Kedro-project path to build the Kedro-Viz artifacts. - # Default: '.' - project_path: '' - - # The flag to include hooks while creating your Kedro-project build artifacts. - # Default: false - include_hooks: '' +1. With `kedro-org/publish-kedro-viz@v1`: + + ```yaml + + - uses: kedro-org/publish-kedro-viz@v1 + with: + # The GitHub token to authenticate deployment. This is autogenerated by the action. + # Default: ${{ github.token }} + github_token: '' + + # The Kedro-project path to build the Kedro-Viz artifacts. + # Default: '.' + project_path: '' + + # The flag to include hooks while creating your Kedro-project build artifacts. + # Default: false + include_hooks: '' + + # Your consent to participate in Kedro-Telemetry. + # Default: true + telemetry_consent: '' + + # The publishing source for GitHub pages. This can be either + # 'branch' or 'workflow' based on your GitHub Pages configuration + # Default: 'branch' + publishing_source: '' + + # The GitHub pages publish branch to upload the artifacts + # if your publishing_source is a branch + # Default: 'gh-pages' + publish_branch: '' + + # The commit message for the deployment, if your publishing_source is a branch. + # Defaults to your original commit message. + # Default: ${{ github.event.head_commit.message }} + commit_message: '' + + # An option to publish branch with only the latest commit + # if your publishing_source is a branch. + # Default: true + force_orphan: '' + + # The git config user.name or the owner of the commit. + # if your publishing_source is a branch. + # Default: 'github-actions[bot]' + user_name: '' + + # The git config user.email or the email of the commit owner. + # if your publishing_source is a branch. + # Default: 'github-actions[bot]@users.noreply.github.com' + user_email: '' + + ``` + +**NOTE:** From publish-kedro-viz@v2, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from publish-kedro-viz@v2. + +2. With `kedro-org/publish-kedro-viz@v2`: + + ```yaml + + - uses: kedro-org/publish-kedro-viz@v2 + with: + # The Kedro-project path to build the Kedro-Viz artifacts. + # Default: '.' + project_path: '' + + # The flag to include hooks while creating your Kedro-project build artifacts. + # Default: false + include_hooks: '' + + # Your consent to participate in Kedro-Telemetry. + # Default: true + telemetry_consent: '' - # Your consent to participate in Kedro-Telemetry. - # Default: true - telemetry_consent: '' - - # The publishing source for GitHub pages. This can be either - # 'branch' or 'workflow' based on your GitHub Pages configuration - # Default: 'branch' - publishing_source: '' - - # The GitHub pages publish branch to upload the artifacts - # if your publishing_source is a branch - # Default: 'gh-pages' - publish_branch: '' - - # The commit message for the deployment, if your publishing_source is a branch. - # Defaults to your original commit message. - # Default: ${{ github.event.head_commit.message }} - commit_message: '' - - # An option to publish branch with only the latest commit - # if your publishing_source is a branch. - # Default: true - force_orphan: '' - - # The git config user.name or the owner of the commit. - # if your publishing_source is a branch. - # Default: 'github-actions[bot]' - user_name: '' - - # The git config user.email or the email of the commit owner. - # if your publishing_source is a branch. - # Default: 'github-actions[bot]@users.noreply.github.com' - user_email: '' - -``` + ``` ## Configure the action @@ -166,8 +190,8 @@ This action helps in the automation of a deployment strategy mentioned in [platf After you've completed the configuration, trigger the workflow as per the workflow trigger condition. - Once triggered, the GitHub workflow "Publish and share Kedro Viz" will automatically start and can be found in the Actions tab with your commit message. -- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. -- If your GitHub Pages publishing source is a custom GitHub Actions workflow, then the artifacts of your Kedro-Viz static site will be uploaded and deployed during the workflow run-time. +- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. Please note that starting v2, we will not upload artifacts to a branch. You can still use publishing source as a branch for GitHub Pages (not recommended) and make sure you follow the security considerations mentioned [here](https://github.com/actions/deploy-pages?tab=readme-ov-file#security-considerations). +- If your GitHub Pages publishing source is a custom GitHub Actions workflow (recommended), then the artifacts of your Kedro-Viz static site will be uploaded and deployed during the workflow run-time. - You can access the static site at `http://.github.io/` ## Credits @@ -176,7 +200,7 @@ The list of third party actions used in this project, with due credits to their ### Deploy to GitHub Pages when publishing source is a branch -We use the GitHub action [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) to deploy the static site to a publish branch which is released under MIT license. +We use the GitHub action [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) in v1, to deploy the static site to a publish branch which is released under MIT license. ### Deploy to GitHub Pages when publishing source is a custom GitHub Action Workflow diff --git a/RELEASE.md b/RELEASE.md index 41b42ed..f1249f5 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,3 +1,10 @@ +# Release 2.0.0: + +## Major features and improvements + +- Remove usage of `peaceiris/actions-gh-pages` +- Update README file + # Release 1.1.0: ## Major features and improvements From 21f975b989320ff078a6e3a7072d74d87bd0d2d3 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Thu, 25 Jul 2024 13:56:48 -0500 Subject: [PATCH 14/18] address PR comments on README --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4d914b..866bf0e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,13 @@ This action helps in the automation of a deployment strategy mentioned in [platf - **Kedro-project dependencies:** Install all the Kedro-project dependencies before using this action in your workflow. - **Python-version:** You need to have an environment with `python>=3.9` in your workflow. -**NOTE:** While configuring your repository for GitHub Pages, you have two publishing source options. You can either choose a branch or a custom GitHub Actions workflow (recommended). If you choose a branch, the build artifacts will be uploaded to the `publish_branch` you pass as an input to the action, which defaults to `gh-pages`. If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action (this is made as default from v2). In this case, no branch will be created and the artifacts are deployed at run-time. Please find more information on configuring a publishing source for github pages site in the [official docs](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). +> [!NOTE] +> While configuring your repository for GitHub Pages, you have two publishing source options. You can either choose a branch or a custom GitHub Actions workflow (recommended). +> If you choose a branch, the build artifacts will be uploaded to the `publish_branch` you pass as an input to the action, which defaults to `gh-pages`. +> If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action (this is made as default from v2). In this case, no branch will be created and the artifacts are deployed at run-time. + +> [!TIP] +> Please find more information on configuring a publishing source for github pages site in the [official docs](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). ## Usage @@ -99,7 +105,8 @@ This action helps in the automation of a deployment strategy mentioned in [platf ``` -**NOTE:** From publish-kedro-viz@v2, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from publish-kedro-viz@v2. +> [!Important] +> From publish-kedro-viz@v2, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from publish-kedro-viz@v2. 2. With `kedro-org/publish-kedro-viz@v2`: @@ -190,9 +197,9 @@ This action helps in the automation of a deployment strategy mentioned in [platf After you've completed the configuration, trigger the workflow as per the workflow trigger condition. - Once triggered, the GitHub workflow "Publish and share Kedro Viz" will automatically start and can be found in the Actions tab with your commit message. -- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. Please note that starting v2, we will not upload artifacts to a branch. You can still use publishing source as a branch for GitHub Pages (not recommended) and make sure you follow the security considerations mentioned [here](https://github.com/actions/deploy-pages?tab=readme-ov-file#security-considerations). - If your GitHub Pages publishing source is a custom GitHub Actions workflow (recommended), then the artifacts of your Kedro-Viz static site will be uploaded and deployed during the workflow run-time. -- You can access the static site at `http://.github.io/` +- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. Please note that starting v2, we will not upload artifacts to a branch. You can still use publishing source as a branch for GitHub Pages (not recommended) and make sure you follow the security considerations mentioned [here](https://github.com/actions/deploy-pages?tab=readme-ov-file#security-considerations). +- You can access the static site at `http://.github.io/`, if your site's visibility is public. For more information on changing the visibility, you can follow the [official docs](https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site) ## Credits From d0fcc440ae5b70851d0c319956329aef9e9c484d Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Thu, 25 Jul 2024 14:02:31 -0500 Subject: [PATCH 15/18] address PR comments on README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 866bf0e..7d7284a 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ This action helps in the automation of a deployment strategy mentioned in [platf ``` > [!Important] -> From publish-kedro-viz@v2, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from publish-kedro-viz@v2. +> From `publish-kedro-viz@v2`, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from `publish-kedro-viz@v2`. 2. With `kedro-org/publish-kedro-viz@v2`: From c18fc9d08bce850b1c2f9dd00d0508ed7a1f8cda Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Fri, 26 Jul 2024 10:15:32 -0500 Subject: [PATCH 16/18] update readme from feedback --- README.md | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 7d7284a..1cc194e 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,37 @@ This action helps in the automation of a deployment strategy mentioned in [platf > [!NOTE] > While configuring your repository for GitHub Pages, you have two publishing source options. You can either choose a branch or a custom GitHub Actions workflow (recommended). > If you choose a branch, the build artifacts will be uploaded to the `publish_branch` you pass as an input to the action, which defaults to `gh-pages`. -> If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action (this is made as default from v2). In this case, no branch will be created and the artifacts are deployed at run-time. +> If you choose a custom GitHub Actions workflow, you need to mention that in the input `publishing_source` to the action. In this case, no branch will be created and the artifacts are deployed at run-time. > [!TIP] > Please find more information on configuring a publishing source for github pages site in the [official docs](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). +> [!Important] +> From `publish-kedro-viz@v2`, we only support custom GitHub Actions workflow as a publishing source for GitHub Pages. ## Usage -1. With `kedro-org/publish-kedro-viz@v1`: +1. With `kedro-org/publish-kedro-viz@v2`: + + ```yaml + + - uses: kedro-org/publish-kedro-viz@v2 + with: + # The Kedro-project path to build the Kedro-Viz artifacts. + # Default: '.' + project_path: '' + + # The flag to include hooks while creating your Kedro-project build artifacts. + # Default: false + include_hooks: '' + + # Your consent to participate in Kedro-Telemetry. + # Default: true + telemetry_consent: '' + + ``` + +2. With `kedro-org/publish-kedro-viz@v1`: ```yaml @@ -105,29 +127,6 @@ This action helps in the automation of a deployment strategy mentioned in [platf ``` -> [!Important] -> From `publish-kedro-viz@v2`, we recommend you to choose a custom GitHub Actions workflow as a publishing source for GitHub Pages. No build artifacts will be pushed to a branch starting from `publish-kedro-viz@v2`. - -2. With `kedro-org/publish-kedro-viz@v2`: - - ```yaml - - - uses: kedro-org/publish-kedro-viz@v2 - with: - # The Kedro-project path to build the Kedro-Viz artifacts. - # Default: '.' - project_path: '' - - # The flag to include hooks while creating your Kedro-project build artifacts. - # Default: false - include_hooks: '' - - # Your consent to participate in Kedro-Telemetry. - # Default: true - telemetry_consent: '' - - ``` - ## Configure the action 1. Adding the GitHub Action to your workflow: @@ -185,7 +184,7 @@ This action helps in the automation of a deployment strategy mentioned in [platf pip install -r requirements.txt # Using the action - name: Deploy Kedro-Viz to GH Pages - uses: kedro-org/publish-kedro-viz@v1 + uses: kedro-org/publish-kedro-viz@v2 with: # This is not required if your Kedro Project # is at the root of your GitHub Repository @@ -198,7 +197,7 @@ After you've completed the configuration, trigger the workflow as per the workfl - Once triggered, the GitHub workflow "Publish and share Kedro Viz" will automatically start and can be found in the Actions tab with your commit message. - If your GitHub Pages publishing source is a custom GitHub Actions workflow (recommended), then the artifacts of your Kedro-Viz static site will be uploaded and deployed during the workflow run-time. -- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. Please note that starting v2, we will not upload artifacts to a branch. You can still use publishing source as a branch for GitHub Pages (not recommended) and make sure you follow the security considerations mentioned [here](https://github.com/actions/deploy-pages?tab=readme-ov-file#security-considerations). +- If your GitHub Pages publishing source is a branch, then the artifacts of your Kedro-Viz static site will be uploaded to the publish-branch input specified in the action upon successful completion of the workflow. Please note that starting from v2, we will not support GitHub Pages publishing source as a branch. - You can access the static site at `http://.github.io/`, if your site's visibility is public. For more information on changing the visibility, you can follow the [official docs](https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site) ## Credits From ece8d24759793f18e6afb23d995f6409a8b92748 Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Fri, 26 Jul 2024 10:56:34 -0500 Subject: [PATCH 17/18] append run attempt --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a3c0187..86beb9e 100644 --- a/action.yml +++ b/action.yml @@ -51,9 +51,9 @@ runs: - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: - name: github-pages-${{ github.run_id }}-${{ github.run_number }} + name: github-pages-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} path: "${{ inputs.project_path }}/build" - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4 with: - artifact_name: github-pages-${{ github.run_id }}-${{ github.run_number }} + artifact_name: github-pages-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} From 5db9e783f8d2ac68860ea3545fe5ed5f9c33c4fa Mon Sep 17 00:00:00 2001 From: ravi-kumar-pilla Date: Mon, 29 Jul 2024 09:57:00 -0500 Subject: [PATCH 18/18] PR comments fix --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 1cc194e..2ec1cd7 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,8 @@ This action helps in the automation of a deployment strategy mentioned in [platf 2. Add the following code to the workflow file: ```yaml - # An example workflow configuration + # An example workflow configuration assuming your kedro project is + # at the root directory # The name of your workflow name: Publish and share Kedro Viz @@ -178,17 +179,11 @@ This action helps in the automation of a deployment strategy mentioned in [platf - name: Install Project Dependencies run: | python -m pip install --upgrade pip - # This is not required if your Kedro Project - # is at the root of your GitHub Repository - cd demo-project pip install -r requirements.txt # Using the action - name: Deploy Kedro-Viz to GH Pages uses: kedro-org/publish-kedro-viz@v2 - with: - # This is not required if your Kedro Project - # is at the root of your GitHub Repository - project_path: 'demo-project' + ``` ## Test the action