Skip to content

Commit

Permalink
Add GH actions files
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Dec 12, 2023
1 parent 5a80991 commit 15074a8
Show file tree
Hide file tree
Showing 31 changed files with 317 additions and 146 deletions.
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"]
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
pull_request:
branches:
- "*"
push:
branches:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1

- name: Install link checker
run: |
curl -fsSL -o liche https://github.com/appscodelabs/liche/releases/download/v0.1.0/liche-linux-amd64
chmod +x liche
sudo mv liche /usr/local/bin/liche
- name: Install codespan schema checker
run: |
curl -fsSL -o codespan-schema-checker https://github.com/kmodules/codespan-schema-checker/releases/download/v0.0.1/codespan-schema-checker-linux-amd64
chmod +x codespan-schema-checker
sudo mv codespan-schema-checker /usr/local/bin/codespan-schema-checker
- name: Check links
run: |
liche -r docs -d $(pwd) -c 10 -p -h -l -x '^(.*/docs/{{<.*>}}/.*|.*github.com.*|.*api.slack.com.*|.*askapache.com.*|.*twitter.com.*)$'
- name: Create Kubernetes cluster
id: kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.17.0

- name: Prepare cluster for testing
id: local-path
run: |
echo "waiting for nodes to be ready ..."
kubectl wait --for=condition=Ready nodes --all --timeout=5m
kubectl get nodes
echo
echo "install helm 3"
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
echo "install stash-crds chart"
helm repo add appscode https://charts.appscode.com/stable/
helm repo update
helm install stash-crds appscode/stash-crds
helm install kubedb-crds appscode/kubedb-crds
helm install kmodules-crds appscode/kmodules-crds
- name: Check codespan schema
run: |
codespan-schema-checker --content=./docs
86 changes: 86 additions & 0 deletions .github/workflows/preview-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: preview-website

on:
pull_request:
branches:
- "*"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: '1.20'
id: go

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '18'

- name: Install yq
run: |
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
chmod +x yqq
sudo mv yqq /usr/local/bin/yqq
pip3 install yq
- 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 Hugo Tools
run: |
curl -fsSL -o hugo-tools https://github.com/appscodelabs/hugo-tools/releases/download/v0.2.23/hugo-tools-linux-amd64
chmod +x hugo-tools
sudo mv hugo-tools /usr/local/bin/hugo-tools
- name: Clone website repository
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
WEBSITE_REPOSITORY: ${{ secrets.WEBSITE_REPOSITORY }}
run: |
url="https://${GITHUB_USER}:${GITHUB_TOKEN}@${WEBSITE_REPOSITORY}.git"
cd $RUNNER_WORKSPACE
git clone $url
cd $(basename $WEBSITE_REPOSITORY)
git config user.name "${GITHUB_USER}"
git config user.email "${GITHUB_USER}@appscode.com"
- name: Update docs
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
WEBSITE_REPOSITORY: ${{ secrets.WEBSITE_REPOSITORY }}
run: |
set -x
export WEBSITE_ROOT=$RUNNER_WORKSPACE/$(basename $WEBSITE_REPOSITORY)
cd $WEBSITE_ROOT
npm install
make assets
hugo-tools update-branch --filename=./data/products/configsyncer.json --branch=${{ github.event.pull_request.head.sha }}
make docs-skip-assets
make gen-prod
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_QA }}'
projectId: kubedb-new-e7965
# target: kubedb-new-e7965
entryPoint: '../website'
env:
FIREBASE_CLI_PREVIEWS: hostingchannels
41 changes: 41 additions & 0 deletions .github/workflows/release-tracker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release-tracker

on:
pull_request:
types: [closed]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1

- name: Prepare git
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
git config --global user.name "${GITHUB_USER}"
git config --global user.email "${GITHUB_USER}@appscode.com"
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
- name: Install GitHub CLI
run: |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
sudo mv bin/hub /usr/local/bin
- name: Update release tracker
if: |
github.event.action == 'closed' &&
github.event.pull_request.merged == true
env:
GITHUB_USER: 1gtm
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
run: |
./hack/scripts/update-release-tracker.sh
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Changelog | Config Syncer
description: Changelog
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: changelog-kubed
name: Changelog
parent: welcome
weight: 10
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: welcome
url: /products/kubed/{{ .version }}/welcome/changelog/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Contributing | Config Syncer
description: Contributing
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: contributing-kubed
name: Contributing
parent: welcome
weight: 15
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: welcome
url: /products/kubed/{{ .version }}/welcome/contributing/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Weclome | Config Syncer
description: Welcome to Config Syncer
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: readme-kubed
name: Readme
parent: welcome
weight: -1
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: welcome
url: /products/kubed/{{ .version }}/welcome/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: Docs | Config Syncer
description: Config Syncer Docs
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: welcome
name: Welcome
weight: 10
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
---
4 changes: 2 additions & 2 deletions docs/concepts/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Concepts | Config Syncer
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: concepts-readme
name: Readme
parent: concepts
weight: -1
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: concepts
url: /products/kubed/{{ .version }}/concepts/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: Concepts
description: Config Syncer Concepts
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: concepts
name: Concepts
weight: 20
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
---
4 changes: 2 additions & 2 deletions docs/concepts/what-is-kubed/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: What is Config Syncer
description: What is Config Syncer
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: what-is-kubed
parent: concepts
name: What is Config Syncer
weight: 10
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
---
4 changes: 2 additions & 2 deletions docs/concepts/what-is-kubed/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Config Syncer Overview
description: Config Syncer Overview
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: overview-concepts
name: Overview
parent: what-is-kubed
weight: 10
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: concepts
---

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Overview
description: Overview of guides
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: guides-overview
name: Overview
parent: guides
weight: -1
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: guides
url: /products/kubed/{{ .version }}/guides/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/_index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Guides | Config Syncer
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: guides
name: Guides
weight: 40
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
---
4 changes: 2 additions & 2 deletions docs/guides/config-syncer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Configuration Syncer | Kubernetes
description: Configuration Syncer for Kubernetes Clusters
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: readme-config-syncer
name: Overview
parent: config-syncer
weight: -1
product_name: kubed
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
section_menu_id: guides
url: /products/kubed/{{ .version }}/guides/config-syncer/
aliases:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/config-syncer/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
title: Configuration Syncer | Kubernetes
description: Configuration Syncer for Kubernetes
menu:
product_kubed_{{ .version }}:
docs_{{ .version }}:
identifier: config-syncer
parent: guides
name: Configuration Syncer
weight: 20
menu_name: product_kubed_{{ .version }}
menu_name: docs_{{ .version }}
---
Loading

0 comments on commit 15074a8

Please sign in to comment.