-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
89 lines (86 loc) · 3.13 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: shareableviz-action
description: This is a test action to publish kedro viz static website on GitHub Pages
author: Ravi Kumar Pilla
branding:
icon: share
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
default: "."
telemetry_consent:
description: "Set your consent if you would like to participate in Kedro-Telemetry. Defaults to true"
required: false
default: false
python_version:
description: "Set a version of python for the deployment. Defaults to 3.11"
required: false
default: "3.11"
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"
steps:
- name: Install Kedro-Viz
run: |
python -m pip install --upgrade pip
python -m pip install "kedro-viz>=7.1.0"
shell: bash
- name: Consent to the use of Kedro-Telemetry
run: |
cd ${{ inputs.project_path }}
echo 'consent: ${{ inputs.telemetry_consent }}' > .telemetry
shell: bash
- name: Create build directory
run: |
cd ${{ inputs.project_path }}
if !(kedro viz build |& 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@v3
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:
path: '${{ inputs.project_path }}/build'
- name: Deploy to GitHub Pages
if: ${{ inputs.publishing_source == 'workflow' }}
uses: actions/deploy-pages@v4