Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Jan 14, 2024
1 parent 487e5ae commit 6cd2ce3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
25 changes: 14 additions & 11 deletions api/.github/workflows/build.yaml → .github/workflows/api-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: deploy
name: API Build & Deploy
on:
push:
branches:
- testnet
- dev
paths:
- 'api/**'
jobs:
main:
runs-on: ubuntu-latest
Expand All @@ -27,14 +29,14 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1

- name: Install kubectl
uses: azure/setup-kubectl@v2.0
uses: azure/setup-kubectl@v2.0

- name: Set kubectl context
uses: azure/k8s-set-context@v3
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}
context: microk8s
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG }}
context: microk8s

- name: Check k8s connection
run: kubectl get pods
Expand All @@ -55,17 +57,18 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Build, tag, and push image to Amazon ECR
working-directory: ./api
env:
DOCKER_TAG: indexnetwork/web3-api:${{ steps.build-time.outputs.time }}
DOCKER_REGISTRY: 236785930124.dkr.ecr.us-east-1.amazonaws.com
run: |
docker build -t $DOCKER_TAG .
docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
docker push $DOCKER_REGISTRY/$DOCKER_TAG
docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/web3-api:latest-${GITHUB_REF#refs/heads/}
docker push $DOCKER_REGISTRY/indexnetwork/web3-api:latest-${GITHUB_REF#refs/heads/}
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
# docker push $DOCKER_REGISTRY/$DOCKER_TAG
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/web3-api:latest-${GITHUB_REF#refs/heads/}
# docker push $DOCKER_REGISTRY/indexnetwork/web3-api:latest-${GITHUB_REF#refs/heads/}
- name: Deploy
run: |-
kubectl set image deployment/api api=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-api:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
kubectl set image deployment/consumer consumer=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-api:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
# kubectl set image deployment/api api=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-api:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
# kubectl set image deployment/consumer consumer=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-api:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: deploy
name: Indexer Build & Deploy
on:
push:
branches:
- testnet
- dev
paths:
- 'indexer/**'
jobs:
main:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,16 +57,17 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Build, tag, and push image to Amazon ECR
working-directory: ./indexer
env:
DOCKER_TAG: indexnetwork/llm-indexer:${{ steps.build-time.outputs.time }}
DOCKER_REGISTRY: 236785930124.dkr.ecr.us-east-1.amazonaws.com
run: |
docker build -t $DOCKER_TAG .
docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
docker push $DOCKER_REGISTRY/$DOCKER_TAG
docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/llm-indexer:latest-${GITHUB_REF#refs/heads/}
docker push $DOCKER_REGISTRY/indexnetwork/llm-indexer:latest-${GITHUB_REF#refs/heads/}
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
# docker push $DOCKER_REGISTRY/$DOCKER_TAG
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/llm-indexer:latest-${GITHUB_REF#refs/heads/}
# docker push $DOCKER_REGISTRY/indexnetwork/llm-indexer:latest-${GITHUB_REF#refs/heads/}
- name: Deploy
run: |-
kubectl set image deployment/llm-indexer llm-indexer=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/llm-indexer:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
# kubectl set image deployment/llm-indexer llm-indexer=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/llm-indexer:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: deploy
name: Web App Build & Deploy
on:
push:
branches:
- testnet
- dev
- testnet
- dev
paths:
- 'web-app/**'
defaults:
run:
working-directory: ./web-app
jobs:
main:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,16 +60,17 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Build, tag, and push image to Amazon ECR
working-directory: ./web-app
env:
DOCKER_TAG: indexnetwork/web3-web-app:${{ steps.build-time.outputs.time }}
DOCKER_REGISTRY: 236785930124.dkr.ecr.us-east-1.amazonaws.com
run: |
docker build -t $DOCKER_TAG .
docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
docker push $DOCKER_REGISTRY/$DOCKER_TAG
docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/web3-web-app:latest-${GITHUB_REF#refs/heads/}
docker push $DOCKER_REGISTRY/indexnetwork/web3-web-app:latest-${GITHUB_REF#refs/heads/}
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/$DOCKER_TAG
# docker push $DOCKER_REGISTRY/$DOCKER_TAG
# docker tag $DOCKER_TAG $DOCKER_REGISTRY/indexnetwork/web3-web-app:latest-${GITHUB_REF#refs/heads/}
# docker push $DOCKER_REGISTRY/indexnetwork/web3-web-app:latest-${GITHUB_REF#refs/heads/}
- name: Deploy
run: |-
kubectl set image deployment/frontend frontend=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-web-app:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}
# kubectl set image deployment/frontend frontend=236785930124.dkr.ecr.us-east-1.amazonaws.com/indexnetwork/web3-web-app:${{ steps.build-time.outputs.time }} --namespace env-${GITHUB_REF#refs/heads/}

0 comments on commit 6cd2ce3

Please sign in to comment.