Skip to content

Workflow file for this run

name: Fyre UI Build and Deploy Pipeline
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"
jobs:
Build-Pipeline:
runs-on: ubuntu-latest
environment: production
steps:
- name: code checkout
uses: actions/checkout@v3
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: install gcloud cli tools
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GOOGLE_PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
install_components: "gke-gcloud-auth-plugin"
export_default_credentials: true
- name: "Use gcloud CLI"
run: "gcloud info"
- name: "Docker Auth"
run: gcloud auth configure-docker ${{ secrets.GOOGLE_ARTIFACT_URL }}
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__NODE_ENV__#${{ vars.NODE_ENV }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_AUTH0_CLIENT_ID__#${{ vars.VUE_APP_AUTH0_CLIENT_ID }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_AUTH0_DOMAIN__#${{ vars.VUE_APP_AUTH0_DOMAIN }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_MOBILEWALLET_URL__#${{ vars.VUE_APP_MOBILEWALLET_URL }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_RECAPTCHA_SITE_KEY__#${{ vars.VUE_APP_RECAPTCHA_SITE_KEY }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_SERVER_WEBSOCKET_URL__#${{ vars.VUE_APP_SERVER_WEBSOCKET_URL }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_TITLE__#${{ vars.VUE_APP_TITLE }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_VERSION__#${{ vars.VUE_APP_VERSION }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_WEBWALLET_URL__#${{ vars.VUE_APP_WEBWALLET_URL }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_GA_CODE__#${{ vars.VUE_APP_GA_CODE }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_KOMMINICATE_APP_ID__#${{ vars.VUE_APP_KOMMINICATE_APP_ID }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY__#${{ vars.VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_INVESTOR_API_SECRET_KEY__#${{ vars.VUE_APP_INVESTOR_API_SECRET_KEY }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_BTN_BACKGROUND__#${{ vars.VUE_APP_BTN_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_HEADER_BACKGROUND__#${{ vars.VUE_APP_HEADER_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_HEADER_TEXT_COLOR__#${{ vars.VUE_APP_HEADER_TEXT_COLOR }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_THEME_BACKGROUND__#${{ vars.VUE_APP_THEME_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_MOOPAY_PAYMENT_URL__#${{ vars.VUE_APP_MOOPAY_PAYMENT_URL }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_FYRE_WALLET_ADDRESS__#${{ vars.VUE_APP_FYRE_WALLET_ADDRESS }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_AUTH0_LOGIN_CLIENT_ID__#${{ vars.VUE_APP_AUTH0_LOGIN_CLIENT_ID }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_TELEGRAM_BOT_ID__#${{ vars.VUE_APP_TELEGRAM_BOT_ID }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_TELEGRAM_VERIFIER_BOT__#${{ vars.VUE_APP_TELEGRAM_VERIFIER_BOT }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_BTN_BACKGROUND__#${{ vars.VUE_APP_BTN_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_BTN_TXT_COLOR__#${{ vars.VUE_APP_BTN_TXT_COLOR }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_HEADER_BACKGROUND__#${{ vars.VUE_APP_HEADER_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_HEADER_TEXT_COLOR__#${{ vars.VUE_APP_HEADER_TEXT_COLOR }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_THEME_BACKGROUND__#${{ vars.VUE_APP_THEME_BACKGROUND }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_STUDIO_SERVER_BASE_URL__#${{ vars.VUE_APP_STUDIO_SERVER_BASE_URL }}#" {} \;
- name: Replace Secrets
run: find Dockerfile -type f -exec sed -i -e "s#__VUE_APP_SERVER_WEBSOCKET_URL__#${{ vars.VUE_APP_SERVER_WEBSOCKET_URL }}#" {} \;
- name: Display secrets
run: cat Dockerfile
- name: "Docker Build and Push"
env:
NODE_ENV: ${{ vars.NODE_ENV }}
VUE_APP_AUTH0_CLIENT_ID: ${{ vars.VUE_APP_AUTH0_CLIENT_ID }}
VUE_APP_AUTH0_DOMAIN: ${{ vars.VUE_APP_AUTH0_DOMAIN }}
VUE_APP_MOBILEWALLET_URL: ${{ vars.VUE_APP_MOBILEWALLET_URL }}
VUE_APP_RECAPTCHA_SITE_KEY: ${{ vars.VUE_APP_RECAPTCHA_SITE_KEY }}
VUE_APP_SERVER_WEBSOCKET_URL: ${{ vars.VUE_APP_SERVER_WEBSOCKET_URL }}
VUE_APP_STUDIO_SERVER_BASE_URL: ${{ vars.VUE_APP_STUDIO_SERVER_BASE_URL }}
VUE_APP_TELEGRAM_BOT_ID: ${{ vars.VUE_APP_TELEGRAM_BOT_ID }}
VUE_APP_TELEGRAM_VERIFIER_BOT: ${{ vars.VUE_APP_TELEGRAM_VERIFIER_BOT }}
VUE_APP_TITLE: ${{ vars.VUE_APP_TITLE }}
VUE_APP_VERSION: ${{ vars.VUE_APP_VERSION }}
VUE_APP_WEBWALLET_URL: ${{ vars.VUE_APP_WEBWALLET_URL }}
VUE_APP_GA_CODE: ${{ vars.VUE_APP_GA_CODE }}
VUE_APP_KOMMINICATE_APP_ID: ${{ vars.VUE_APP_KOMMINICATE_APP_ID }}
VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY: ${{ vars.VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY }}
VUE_APP_INVESTOR_API_SECRET_KEY: ${{ vars.VUE_APP_INVESTOR_API_SECRET_KEY }}
VUE_APP_BTN_BACKGROUND: ${{ vars.VUE_APP_BTN_BACKGROUND }}
VUE_APP_BTN_TXT_COLOR: ${{ vars.VUE_APP_BTN_TXT_COLOR }}
VUE_APP_HEADER_BACKGROUND: ${{ vars.VUE_APP_HEADER_BACKGROUND }}
VUE_APP_HEADER_TEXT_COLOR: ${{ vars.VUE_APP_HEADER_TEXT_COLOR }}
VUE_APP_THEME_BACKGROUND: ${{ vars.VUE_APP_THEME_BACKGROUND }}
VUE_APP_MOOPAY_PAYMENT_URL: ${{ vars.VUE_APP_MOOPAY_PAYMENT_URL }}
VUE_APP_FYRE_WALLET_ADDRESS: ${{ vars.VUE_APP_FYRE_WALLET_ADDRESS }}
VUE_APP_AUTH0_LOGIN_CLIENT_ID: ${{ vars.VUE_APP_AUTH0_LOGIN_CLIENT_ID }}
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
run:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/fyre-frontend:${{ env.LATEST_RELEASE_TAG }} .
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/fyre-frontend:${{ env.LATEST_RELEASE_TAG }}
Deploy-Pipeline:
needs: [Build-Pipeline]
runs-on: ubuntu-latest
environment: production
steps:
- name: code checkout
uses: actions/checkout@v3
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: install gcloud cli tools
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
install_components: "gke-gcloud-auth-plugin"
export_default_credentials: true
- name: "Configure kubectl"
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1
- name: Replace tags
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
- name: "Deploy to GKE"
run: kubectl apply -f .deploy/deployment.yaml