forked from RoadieHQ/sample-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple-site-template.yaml
88 lines (80 loc) · 2.7 KB
/
simple-site-template.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
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
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: github-pages-website-with-branch
title: GitHub Pages Website With Branch selection
description: Create a static HTML website and publish it via GitHub pages.
spec:
owner: user:dtuite
type: website
parameters:
- title: Provide some simple information
required:
- website_name
properties:
website_name:
title: Website name
type: string
description: This will be displayed prominantly on your website and in the title tag.
- title: Choose a Source Control Management tool to store your new website in.
required:
- repoUrl
properties:
repoUrl:
title: Repository Location
type: string
ui:field: RepoUrlPicker
ui:options:
allowedHosts:
- github.com
- title: Default branch on the repository
required:
- defaultBranch
properties:
defaultBranch:
title: Default Branch
type: string
description: This will be used as the default branch on the repository
steps:
- id: template
name: Fetch Skeleton + Template
action: fetch:template
input:
url: ./skeleton
values:
website_name: ${{ parameters.website_name }}
repo_name: ${{ (parameters.repoUrl | parseRepoUrl)["repo"] }}
repo_owner: ${{ (parameters.repoUrl | parseRepoUrl)["owner"] }}
- id: publishToGitHub
name: Publish to GitHub
action: publish:github
input:
allowedHosts: ['github.com']
description: 'A static HTML website. Just like the good old days.'
repoUrl: ${{ parameters.repoUrl }}
defaultBranch: ${{ parameters.defaultBranch }}
repoVisibility: public
- id: publishToWeb
name: Publish to web with GitHub Pages
action: http:backstage:request
input:
method: 'POST'
path: /api/proxy/github/api/repos/${{ (parameters.repoUrl | parseRepoUrl)["owner"] }}/${{ (parameters.repoUrl | parseRepoUrl)["repo"] }}/pages
headers:
content-type: 'application/json'
body:
source:
branch: main
path: '/'
- id: registerInBetterUptime
name: Register in Better Uptime
action: http:backstage:request
input:
method: 'POST'
path: /api/proxy/betteruptime/monitors
headers:
content-type: 'application/json'
body:
url: https://${{ (parameters.repoUrl | parseRepoUrl)["owner"] }}.github.io/${{ (parameters.repoUrl | parseRepoUrl)["repo"] }}/
output:
remoteUrl: ${{ steps.publishToGitHub.output.remoteUrl }}