-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
87 lines (85 loc) · 2.43 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
name: reposense-action
description: 'Deploy your RepoSense Report'
branding:
icon: 'upload-cloud'
color: 'green'
inputs:
token:
description: the required token for deployment
required: true
version:
description: the RepoSense version to use (release/master/tag v1.6.1/etc)
default: 'release'
type: string
configDirectory:
description: the directory to read the config files from
default: 'configs'
type: string
service:
description: the publishing service (gh-pages/surge)
default: 'gh-pages'
type: string
domain:
description: the domain to use
type: string
cliArgs:
description: any other arguments to pass to generate RepoSense report
default: ''
type: string
runs:
using: 'composite'
steps:
- name: Checkout RepoSense scripts
uses: actions/checkout@v3
with:
repository: reposense/reposense-action
path: '.'
- name: Checkout source repo
uses: actions/checkout@v3
with:
path: curr-repo
- name: Check if config folder exists
run: |
if [ ! -d "./curr-repo/${{ inputs.configDirectory }}" ]; then
echo "No configs folder found. Exiting!"
exit 1
fi
shell: bash
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: pip install requests
shell: bash
- name: Install Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Get RepoSense
run: bash ./run.sh ${{ inputs.version }}
shell: bash
- name: Generate report
run: java -jar RepoSense.jar --config ./curr-repo/${{ inputs.configDirectory }} ${{ inputs.cliArgs}}
shell: bash
- name: Deploy via gh-pages
if: inputs.service == 'gh-pages'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ inputs.token }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
publish_dir: ./reposense-report
- name: Install Node
uses: actions/setup-node@v2
if: inputs.service == 'surge'
with:
node-version: 12
- name: Deploy via Surge.sh
if: inputs.service == 'surge'
run: |
npm i -g surge
surge --project ./reposense-report --domain ${{ inputs.domain }}
shell: bash
env:
SURGE_TOKEN: ${{ inputs.token }}