diff --git a/README.md b/README.md index 3fb7768..2ec1cd7 100644 --- a/README.md +++ b/README.md @@ -40,62 +40,92 @@ 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. 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 -```yaml +1. With `kedro-org/publish-kedro-viz@v2`: -- 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: '' + ```yaml - # The Kedro-project path to build the Kedro-Viz artifacts. - # Default: '.' - project_path: '' + - 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: '' + # 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: '' - -``` + ``` + +2. 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: '' + + ``` ## Configure the action @@ -105,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 @@ -148,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@v1 - with: - # This is not required if your Kedro Project - # is at the root of your GitHub Repository - project_path: 'demo-project' + uses: kedro-org/publish-kedro-viz@v2 + ``` ## Test the action @@ -166,9 +191,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. -- 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. -- You can access the static site at `http://.github.io/` +- 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 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 @@ -176,7 +201,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 diff --git a/action.yml b/action.yml index 2fa2123..86beb9e 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" @@ -76,22 +48,12 @@ runs: 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 }} - name: Upload GitHub Pages artifact - if: ${{ inputs.publishing_source == 'workflow' }} uses: actions/upload-pages-artifact@v3 with: + name: github-pages-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} path: "${{ inputs.project_path }}/build" - name: Deploy to GitHub Pages - if: ${{ inputs.publishing_source == 'workflow' }} uses: actions/deploy-pages@v4 + with: + artifact_name: github-pages-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}