-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added pipeline added brew.sh script added concurrency to all pipelines
- Loading branch information
Showing
7 changed files
with
153 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Testnet CD for graphix | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
uses: ./.github/workflows/template-deploy.yaml | ||
with: | ||
ENVIRONMENT: testnet | ||
secrets: | ||
GCP_SECRET: ${{ secrets.GCP_GRAPH_NETWORK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Template Deploy | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
GCP_PROJECT_ID: | ||
required: false | ||
type: string | ||
default: graph-mainnet | ||
CLUSTER_NAME: | ||
required: false | ||
type: string | ||
default: testnet | ||
CLUSTER_LOCATION: | ||
required: false | ||
type: string | ||
default: us-central1-a | ||
ENVIRONMENT: | ||
required: false | ||
type: string | ||
default: testnet | ||
ENABLE_DIFF: | ||
required: false | ||
type: boolean | ||
default: true | ||
ENABLE_APPLY: | ||
required: false | ||
type: boolean | ||
default: false | ||
secrets: | ||
GCP_SECRET: | ||
required: true | ||
|
||
jobs: | ||
template-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
|
||
- id: "auth" | ||
uses: "google-github-actions/auth@v1" | ||
with: | ||
credentials_json: ${{ secrets.GCP_SECRET }} | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v0 | ||
with: | ||
project_id: ${{ inputs.GCP_PROJECT_ID }} | ||
|
||
- id: "get-credentials" | ||
uses: "google-github-actions/get-gke-credentials@v1" | ||
with: | ||
cluster_name: ${{ inputs.CLUSTER_NAME }} | ||
location: ${{ inputs.CLUSTER_LOCATION }} | ||
|
||
- name: Enable homebrew | ||
uses: raviqqe/[email protected] | ||
|
||
- name: Install infrastructure tools | ||
run: ./brew.sh | ||
|
||
- name: Diff ${{ inputs.ENVIRONMENT }} | ||
if: inputs.ENABLE_DIFF | ||
working-directory: k8s | ||
run: kubectl diff -k ${{ inputs.ENVIRONMENT }} | ||
|
||
- name: Deploy to ${{ inputs.ENVIRONMENT }} cluster | ||
if: inputs.ENABLE_APPLY | ||
working-directory: k8s | ||
run: kubectl apply -k ${{ inputs.ENVIRONMENT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
brew install cask google-cloud-sdk | ||
gcloud components install gke-gcloud-auth-plugin | ||
|
||
curl -LO "https://dl.k8s.io/release/v1.24.1/bin/linux/amd64/kubectl" | ||
chmod +x ./kubectl | ||
mv ./kubectl /usr/local/bin/kubectl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: graphix | ||
labels: | ||
app: graphix | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: graphix | ||
template: | ||
metadata: | ||
labels: | ||
app: graphix | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/path: "/metrics" | ||
prometheus.io/port: "7300" | ||
spec: | ||
imagePullSecrets: | ||
- name: docker-registry | ||
containers: | ||
- name: graphix | ||
image: graphix:to-be-replaced-by-kustomize | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- name: graphix | ||
containerPort: 80 | ||
- name: metrics | ||
containerPort: 7300 | ||
command: | ||
- sleep | ||
- infinte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- deployment.yaml | ||
# - service.yaml | ||
# - ingress.yaml | ||
# - servicemonitor.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
bases: | ||
- ../base | ||
|
||
images: | ||
- name: graphix | ||
newName: ghcr.io/edgeandnode/graphix-cross-checker | ||
newTag: latest |