Skip to content

Commit

Permalink
Deployer enabled (#2)
Browse files Browse the repository at this point in the history
* Enable deployer

* Update workflow

* update ethstats-client-deployment

* ethstats-client image

* Ethstats deployment dependency
  • Loading branch information
dhidalgX authored Apr 23, 2024
1 parent a140b42 commit dda71ff
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ethstats-client-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Ethstats Web Build/Push & VKE Deployment
on:
workflow_run:
workflows: ["Build Docker image"]
types:
- completed

jobs:
dockerhubpush-VKEdeploy:

name: Deploy ethstats-client
runs-on: ubuntu-latest
steps:
- name: Get tag
id: vars
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
echo "tag=${TAG_NAME}" >> $GITHUB_ENV
if [[ $TAG_NAME == "mainnet-v"* ]]; then
echo "namespace=ethstats-main" >> $GITHUB_ENV
elif [[ $TAG_NAME == "testnet-v"* ]]; then
echo "namespace=ethstats" >> $GITHUB_ENV
else
echo "::error::Unrecognized tag format: $TAG_NAME"
exit 1
fi
- name: Checkout code
uses: actions/checkout@v3

- name: Install kubectl
uses: azure/k8s-set-context@v3
with:
kubeconfig: ${{ secrets.VKE_TEST_KUBECONFIG }}

- name: Install Kustomize
uses: imranismail/setup-kustomize@v2

- name: Configure K8s Cluster Access for VKE
env:
VKE_TEST_KUBECONFIG: ${{ secrets.VKE_TEST_KUBECONFIG }}
run: |
echo $VKE_TEST_KUBECONFIG > ./kubeconfig.yaml
export KUBECONFIG=$PWD/kubeconfig.yaml
- name: Update Image Tag in Client
run: |
kustomize edit set image hemilabs/ethstats-client:latest=hemilabs/ethstats-client:${{ env.tag }}
kustomize edit set namespace ${{ env.namespace }}
working-directory: ./infrastructure/ethstats-client

- name: Deploy to VKE
run: |
kustomize build ./infrastructure/ethstats-client
kubectl apply -k ./infrastructure/ethstats-client
27 changes: 27 additions & 0 deletions infraestructure/ethstats-client/ethstats-client-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ethstats-client
spec:
replicas: 1
selector:
matchLabels:
app: ethstats-client
template:
metadata:
labels:
app: ethstats-client
spec:
containers:
- name: ethstats-client
image: hemilabs/ethstats-client:latest
envFrom:
- configMapRef:
name: ethstats-client-env
restartPolicy: Always
imagePullSecrets:
- name: dockerhub-secret




2 changes: 2 additions & 0 deletions infraestructure/ethstats-client/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- ethstats-client-deployment.yaml

0 comments on commit dda71ff

Please sign in to comment.