Merge pull request #5 from ETHCF/ethva #28
Workflow file for this run
This file contains hidden or 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 Push Docker Image | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| backend: | |
| name: Build and Push Backend Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build and push Backend Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| context: ./backend | |
| file: ./backend/Dockerfile | |
| platforms: linux/amd64 | |
| tags: | | |
| ethcf/transparency:backend-${{ github.ref_name }} | |
| ethcf/transparency:backend-latest | |
| frontend: | |
| name: Build and Push Frontend Docker Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Build and push Frontend Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| context: ./frontend | |
| file: ./frontend/Dockerfile | |
| platforms: linux/amd64 | |
| tags: | | |
| ethcf/transparency:frontend-${{ github.ref_name }} | |
| ethcf/transparency:frontend-latest | |
| deploy-ethcf: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| needs: [backend, frontend] | |
| name: Deploy ETHCF Transparency Dashboard | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4.3.1 | |
| with: | |
| version: ${{ vars.HELM_VERSION }} | |
| - name: Google Auth | |
| id: auth | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| token_format: 'access_token' | |
| workload_identity_provider: '${{ secrets.WIF_PROVIDER_ID }}' | |
| service_account: '${{ secrets.SERVICE_ACCOUNT_EMAIL }}' | |
| - name: 'Set up Cloud SDK' | |
| uses: 'google-github-actions/setup-gcloud@v2' | |
| with: | |
| version: '>= ${{ vars.GCP_SDK_VERSION }}' | |
| - name: 'Install kubectl' | |
| run: 'gcloud components install kubectl' | |
| - name: 'Get cluster credentials' | |
| run: 'gcloud container clusters get-credentials ${{ secrets.CLUSTER_NAME }} --region ${{ secrets.REGION }}' | |
| - name: 'Install bitnami helm repo' | |
| run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
| - name: 'Install helm deps' | |
| working-directory: ./helm | |
| run: helm dependency build | |
| - name: 'Deploy' | |
| run: | | |
| helm upgrade --install ${{ vars.SERVICE_NAME }} ./helm --values ops/ethcf.yaml \ | |
| --set backend.image.tag=backend-${{ github.ref_name }} \ | |
| --set dashboard.image.tag=frontend-${{ github.ref_name }} \ | |
| --namespace ${{ secrets.NAMESPACE }} --create-namespace --set namespace=${{ secrets.NAMESPACE }} \ | |
| --set global.alchemy.apiKey=${{ secrets.ALCHEMY_KEY }} \ | |
| --set global.initialAdminAddress=${{ secrets.INITIAL_ADMIN }} \ | |
| --set global.rpcURL=${{ secrets.RPC_URL }} \ | |
| --set externalPostgresql.host=${{ secrets.DB_HOST }} | |
| deploy-ethva: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| needs: [backend, frontend] | |
| name: Deploy ETHVA Transparency Dashboard | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4.3.1 | |
| with: | |
| version: ${{ vars.HELM_VERSION }} | |
| - name: Google Auth | |
| id: auth | |
| uses: 'google-github-actions/auth@v2' | |
| with: | |
| token_format: 'access_token' | |
| workload_identity_provider: '${{ secrets.WIF_PROVIDER_ID }}' | |
| service_account: '${{ secrets.SERVICE_ACCOUNT_EMAIL }}' | |
| - name: 'Set up Cloud SDK' | |
| uses: 'google-github-actions/setup-gcloud@v2' | |
| with: | |
| version: '>= ${{ vars.GCP_SDK_VERSION }}' | |
| - name: 'Install kubectl' | |
| run: 'gcloud components install kubectl' | |
| - name: 'Get cluster credentials' | |
| run: 'gcloud container clusters get-credentials ${{ secrets.CLUSTER_NAME }} --region ${{ secrets.REGION }}' | |
| - name: 'Install bitnami helm repo' | |
| run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
| - name: 'Install helm deps' | |
| working-directory: ./helm | |
| run: helm dependency build | |
| - name: 'Deploy' | |
| run: | | |
| helm upgrade --install ${{ vars.SERVICE_NAME }} ./helm --values ops/ethva.yaml \ | |
| --set backend.image.tag=backend-${{ github.ref_name }} \ | |
| --set dashboard.image.tag=frontend-${{ github.ref_name }} \ | |
| --namespace ${{ secrets.NAMESPACE }} --create-namespace --set namespace=${{ secrets.NAMESPACE }} \ | |
| --set global.alchemy.apiKey=${{ secrets.ALCHEMY_KEY }} \ | |
| --set global.initialAdminAddress=${{ secrets.INITIAL_ADMIN }} \ | |
| --set global.rpcURL=${{ secrets.RPC_URL }} \ | |
| --set externalPostgresql.host=${{ secrets.DB_HOST }} |