Skip to content

[M] Deploy Obscuro Gateway Testnet ( dev-testnet ) #42

[M] Deploy Obscuro Gateway Testnet ( dev-testnet )

[M] Deploy Obscuro Gateway Testnet ( dev-testnet ) #42

# Deploys Obscuro Gateway on Azure for Testnet
# Builds the Obscuro Gateway image, pushes the image to dockerhub and starts the Obscuro Gateway on Azure
name: '[M] Deploy Obscuro Gateway Testnet'
run-name: '[M] Deploy Obscuro Gateway Testnet ( ${{ github.event.inputs.testnet_type }} )'
on:
workflow_dispatch:
inputs:
testnet_type:
description: 'Testnet Type'
required: true
default: 'dev-testnet'
type: choice
options:
- 'dev-testnet'
- 'testnet'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 'Set up Docker'
uses: docker/setup-buildx-action@v1
- name: 'Set Obscuro Gateway variables for testnet'
if: ${{ github.event.inputs.testnet_type == 'testnet' }}
run: |
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_NODE_HOST=testnet.obscu.ro" >> $GITHUB_ENV
- name: 'Set Obscuro Gateway variables for dev-testnet'
if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }}
run: |
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_obscuro_gateway_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_NODE_HOST=dev-testnet.obscu.ro" >> $GITHUB_ENV
- 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 -t ${{ env.OBSCURO_GATEWAY_BUILD_TAG }} -f ./tools/walletextension/Dockerfile .
docker push ${{ env.OBSCURO_GATEWAY_BUILD_TAG }}
- name: 'Deploy to Azure Container Instances'
uses: 'azure/aci-deploy@v1'
with:
resource-group: ${{ secrets.RESOURCE_GROUP }}
dns-name-label: ${{ github.event.inputs.testnet_type }}-obscuro-gateway
image: ${{ env.OBSCURO_GATEWAY_BUILD_TAG }}
name: ${{ github.event.inputs.testnet_type }}-obscuro-gateway
location: 'uksouth'
restart-policy: 'Never'
environment-variables: PORT=80
command-line: ./wallet_extension_linux -host=0.0.0.0 -port=80 -portWS=81 -nodeHost=${{ env.OBSCURO_GATEWAY_NODE_HOST }} -dbType=mariaDB -dbConnectionURL=obscurouser:${{ secrets.OBSCURO_GATEWAY_MARIADB_USER_PWD }}@tcp(obscurogateway-mariadb-${{ github.event.inputs.testnet_type }}.uksouth.cloudapp.azure.com:3306)/ogdb
ports: '80,81'
cpu: 2
memory: 2