Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed May 2, 2024
0 parents commit 88c4e0b
Show file tree
Hide file tree
Showing 16 changed files with 251 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"projects": {
"default": "appscode-govanityurls"
},
"targets": {
"appscode-govanityurls": {
"hosting": {
"hugo": [
"searchlight-govanityurls"
]
}
}
}
}
18 changes: 18 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version = 1

[merge]
method = "squash" # default: "merge"
delete_branch_on_merge = true # default: false
optimistic_updates = true # default: true
prioritize_ready_to_merge = true # default: false

[merge.message]
title = "pull_request_title" # default: "github_default"
body = "github_default" # default: "github_default"
strip_html_comments = true # default: false

[update]
always = true # default: false

[approve]
auto_approve_usernames = ["1gtm", "tamalsaha"]
32 changes: 32 additions & 0 deletions .github/workflows/preview-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: preview-website

on: pull_request

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: true

- uses: actions/setup-node@v1
with:
node-version: '18'

- name: Install Hugo
run: |
curl -fsSL -o hugo_extended.deb https://github.com/gohugoio/hugo/releases/download/v0.111.1/hugo_extended_0.111.1_linux-amd64.deb
sudo dpkg -i hugo_extended.deb
rm hugo_extended.deb
- name: Generate Website
run: |
make gen
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_APPSCODE_GOVANIURLS }}'
expires: 1d
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
push:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
with:
submodules: true

- uses: actions/setup-node@v1
with:
node-version: '18'

- name: Install Hugo
run: |
curl -fsSL -o hugo_extended.deb https://github.com/gohugoio/hugo/releases/download/v0.111.1/hugo_extended_0.111.1_linux-amd64.deb
sudo dpkg -i hugo_extended.deb
rm hugo_extended.deb
- name: Install Firebase CLI
run: |
npm i -g firebase-tools
- name: Generate Website
run: |
make gen
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_APPSCODE_GOVANIURLS }}'
channelId: live
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.firebase
/content/docs
/node_modules
/repos
/resources
.sass-cache
/public
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/govanity"]
path = themes/govanity
url = https://github.com/appscodelabs/hugo-theme-govanity.git
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: run
run:
hugo server

.PHONY: gen
gen:
rm -rf public
hugo --minify

.PHONY: release
release: gen
firebase use default
firebase deploy
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# govanityurls

## Create Hugo Project

```bash
hugo new site govanityurls
cd govanityurls
git init
git submodule add https://github.com/appscodelabs/hugo-theme-govanity.git themes/govanity
echo theme = \"govanity\" >> config.toml
```

## Firebase Configuration

- https://firebase.google.com/docs/hosting/multisites
- https://github.com/FirebaseExtended/action-hosting-deploy#options
6 changes: 6 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

4 changes: 4 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
baseURL = 'http://example.org/'
languageCode = 'en-us'
title = 'GO Vanity URL Website'
theme = 'govanity'
7 changes: 7 additions & 0 deletions data/vanity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
host: go.opscenter.dev

paths:
/inbox-agent:
repo: https://github.com/ops-center/inbox-agent
/installer:
repo: https://github.com/ops-center/installer
11 changes: 11 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hosting": {
"target": "hugo",
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}
26 changes: 26 additions & 0 deletions hack/scripts/create-firebase-sites.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

projects=( \
appscode \
bytebuilders \
gomodules \
kmodules \
kubedb \
kubeform \
kubeguard \
kubeops \
kubepack \
kubeshield \
kubevault \
open-viz \
pharmer \
searchlight \
stashed \
voyagermesh \
wandrs \
)

firebase use default
for p in "${projects[@]}"; do
firebase hosting:sites:create $p-govanityurls
done
29 changes: 29 additions & 0 deletions hack/scripts/create-gh-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

projects=( \
appscode \
bytebuilders \
gomodules \
kmodules \
kubedb \
kubeform \
kubeguard \
kubeops \
kubepack \
kubeshield \
kubevault \
open-viz \
pharmer \
searchlight \
stashed \
voyagermesh \
wandrs \
)

gsa=$(cat /personal/AppsCode/credentials/[email protected])
gh secret set FIREBASE_SERVICE_ACCOUNT_APPSCODE_GOVANIURLS -b"${gsa}" -R appscodelabs/govanityurls

for p in "${projects[@]}"; do
gh repo create -y --public --template=appscodelabs/govanityurls $p/govanityurls
gh secret set FIREBASE_SERVICE_ACCOUNT_APPSCODE_GOVANIURLS -b"${gsa}" -R $p/govanityurls
done
25 changes: 25 additions & 0 deletions hack/scripts/rm-gh-secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

projects=( \
appscode \
bytebuilders \
gomodules \
kmodules \
kubedb \
kubeform \
kubeguard \
kubeops \
kubepack \
kubeshield \
kubevault \
open-viz \
pharmer \
searchlight \
stashed \
voyagermesh \
wandrs \
)

for p in "${projects[@]}"; do
gh secret remove -o $p GOVANITYURLS_SERVICE_ACCOUNT_JSON_KEY
done
1 change: 1 addition & 0 deletions themes/govanity
Submodule govanity added at 51837b

0 comments on commit 88c4e0b

Please sign in to comment.