feat: add colums admin #409
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
name: Build and Deploy Next JS App on DigitalOcean K8s Cluster | |
on: | |
push: | |
branches: | |
- dev | |
- staging | |
- production | |
jobs: | |
build-job: | |
name: Build YAM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest git repo | |
uses: actions/checkout@main | |
- name: Validate Access Token | |
run: echo ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Build container image | |
run: docker build | |
--build-arg BUILD_ENV=${GITHUB_REF_NAME} | |
--build-arg COMMUNITY_API_KEY_ARG=${{ secrets.COMMUNITY_API_KEY }} | |
--build-arg NEXT_PUBLIC_WALLET_CONNECT_KEY_ARG=${{ secrets.NEXT_PUBLIC_WALLET_CONNECT_KEY }} | |
-t registry.digitalocean.com/yam-realtoken-cr/${GITHUB_REF##*/}:$(echo $GITHUB_SHA | head -c7) . | |
- name: Log in to DigitalOcean Container Registry with short-lived credentials | |
run: doctl registry login --expiry-seconds 1200 | |
- name: Push image to DigitalOcean Container Registry | |
run: docker push registry.digitalocean.com/yam-realtoken-cr/${GITHUB_REF##*/}:$(echo $GITHUB_SHA | head -c7) | |
- name: Update Docker Image in Deployment file | |
run: TAG=$(echo $GITHUB_SHA | head -c7) && ENV_PREFIX=$(echo ${GITHUB_REF##*/}) && sed -i 's|<IMAGE>|registry.digitalocean.com/yam-realtoken-cr/'${ENV_PREFIX}':'${TAG}'|' $GITHUB_WORKSPACE/k8s-yaml/deployment.yaml && cat $GITHUB_WORKSPACE/k8s-yaml/deployment.yaml | |
- name: Update Environment Prefix in Deployment|Service|Ingress files | |
run: ENV_PREFIX=$(echo ${GITHUB_REF##*/}) && sed -i 's|<ENV_PREFIX>|'${ENV_PREFIX}'|' $GITHUB_WORKSPACE/k8s-yaml/*.yaml && cat $GITHUB_WORKSPACE/k8s-yaml/*.yaml | |
- name: Update Environment Prefix in Cert-issuer files | |
run: ENV_PREFIX=$(echo ${GITHUB_REF##*/}) && sed -i 's|<ENV_PREFIX>|'${ENV_PREFIX}'|' $GITHUB_WORKSPACE/k8s-yaml/cert-manager/*.yaml && cat $GITHUB_WORKSPACE/k8s-yaml/cert-manager/*.yaml | |
- name: Update Ingress Host if Production | |
if: github.ref == 'refs/heads/production' | |
run: | | |
sed -i 's|production-yam.realtoken.network|'yam.realtoken.network'|' $GITHUB_WORKSPACE/k8s-yaml/ingress.yaml && cat $GITHUB_WORKSPACE/k8s-yaml/ingress.yaml | |
- name: Save DigitalOcean kubeconfig with short-lived credentials | |
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 yam-realtoken-k8s | |
- name: Deploy to DigitalOcean Kubernetes | |
run: kubectl apply -f $GITHUB_WORKSPACE/k8s-yaml --recursive | |
- name: Verify deployment | |
run: kubectl rollout status deployment/${GITHUB_REF##*/}-yam-realtoken |