Skip to content

[M] Deploy Ten Gateway Frontend ( dev-testnet ) #27

[M] Deploy Ten Gateway Frontend ( dev-testnet )

[M] Deploy Ten Gateway Frontend ( dev-testnet ) #27

# Deploys Ten Gateway Frontend on Azure for Testnet
# Builds the Ten Gateway image, pushes the image to dockerhub and starts the Ten Gateway on Azure VM
name: '[M] Deploy Ten Gateway Frontend'
run-name: '[M] Deploy Ten Gateway Frontend ( ${{ github.event.inputs.testnet_type }} )'
on:
workflow_dispatch:
inputs:
testnet_type:
description: 'Testnet Type'
required: true
default: 'dev-testnet'
type: choice
options:
- 'dev-testnet'
- 'uat-testnet'
- 'sepolia-testnet'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.testnet_type }}
steps:
- name: 'Print GitHub variables'
run: |
echo "Selected Testnet Type: ${{ matrix.testnet_type }}"
echo "Gateway API URL: ${{ vars.GATEWAY_URL }}"
- uses: actions/checkout@v4
- name: 'Extract branch name'
shell: bash
run: |
echo "Branch Name: ${GITHUB_REF_NAME}"
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: 'Set up Docker'
uses: docker/[email protected]
- name: 'Login to Azure docker registry'
uses: azure/docker-login@v1
with:
login-server: testnetobscuronet.azurecr.io
username: testnetobscuronet
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and Push Docker Image
run: |
DOCKER_BUILDKIT=1 docker build --build-arg GATEWAY_API_URL=${{ vars.GATEWAY_URL }} -t ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }} -f ./tools/walletextension/frontend/Dockerfile .
docker push ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }}
- name: "Deploy Gateway FE to Azure Container Instances"
uses: "azure/aci-deploy@v1"
with:
resource-group: ${{ secrets.RESOURCE_GROUP }}
dns-name-label: ${{ github.event.inputs.testnet_type }}-ten-gateway
image: ${{ vars.DOCKER_BUILD_TAG_GATEWAY_FE }}
name: ${{ github.event.inputs.testnet_type }}-fe-ten-gateway
location: "uksouth"
restart-policy: "Never"
ports: "80"
cpu: 2
memory: 2