-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yaml
56 lines (54 loc) · 2.18 KB
/
action.yaml
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
name: 'Publish Documentation'
description: 'Generates and deploys an aggregated single page documentation to a Google cloud storage bucket'
inputs:
gcloud-service-auth:
required: true
description: 'Credentials file for gcloud set up'
bucket-name:
required: true
description: 'The name of the Google storage bucket to upload documentation to'
go-version:
required: false
description: 'The version of go used to install md2html converter'
default: '1.18.4'
markdown-file-paths:
required: true
description: 'List of relative paths of markdown files to include'
css-file-path:
required: false
description: 'Relative path to the CSS file to use for styling the aggregated documentation HTML page'
default: 'styles/default.css'
documentation-page-title:
required: true
description: 'Title of the single page documentation page'
documentation-file-storage-name:
required: true
description: 'Name used to store the single page HTML documentation page in Google Cloud storage bucket'
runs:
using: "composite"
steps:
- name: Install and set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.go-version }}
- name: Generate single page HTML documentation
run: ${{ github.action_path }}/action-scripts/generate-single-page-doc.sh
shell: bash
env:
LIST_OF_PATHS_TO_MARKDOWN_FILES: ${{ inputs.markdown-file-paths }}
PATH_TO_CSS_FILE: ${{ github.action_path }}/${{ inputs.css-file-path }}
PAGE_TITLE: ${{ inputs.documentation-page-title }}
DOCUMENTATION_FILE_NAME: ${{ inputs.documentation-file-storage-name }}
- name: Login to Google Cloud
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ inputs.gcloud-service-auth }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Upload generated single page documentation (aggregate of all specified mark down files)
uses: google-github-actions/upload-cloud-storage@v1
with:
headers: |-
content-type: text/html
path: '${{ inputs.documentation-file-storage-name }}'
destination: '${{ inputs.bucket-name }}'