forked from cubedro/eth-net-intelligence-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable deployer * Update workflow * update ethstats-client-deployment * ethstats-client image * Ethstats deployment dependency
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
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,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
27
infraestructure/ethstats-client/ethstats-client-deployment.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,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 | ||
|
||
|
||
|
||
|
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,2 @@ | ||
resources: | ||
- ethstats-client-deployment.yaml |