-
Notifications
You must be signed in to change notification settings - Fork 38
87 lines (78 loc) · 3.28 KB
/
manual-deploy-ten-gateway-frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# 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 }}
strategy:
fail-fast: false
matrix:
include:
- testnet_type: 'dev-testnet'
GATEWAY_API_URL: 'https://obscurogateway-dev-testnet.uksouth.cloudapp.azure.com'
- testnet_type: 'uat-testnet'
GATEWAY_API_URL: 'https://obscurogateway-uat-testnet.uksouth.cloudapp.azure.com'
- testnet_type: 'sepolia-testnet'
GATEWAY_API_URL: 'https://obscurogateway-sepolia-testnet.uksouth.cloudapp.azure.com'
steps:
- name: 'Print GitHub variables'
if: matrix.testnet_type == github.event.inputs.testnet_type
run: |
echo "Selected Testnet Type: ${{ matrix.testnet_type }}"
echo "Gateway API URL: ${{ matrix.GATEWAY_API_URL }}"
- uses: actions/checkout@v3
if: matrix.testnet_type == github.event.inputs.testnet_type
- name: 'Extract branch name'
if: matrix.testnet_type == github.event.inputs.testnet_type
shell: bash
run: |
echo "Branch Name: ${GITHUB_REF_NAME}"
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: 'Set up Docker'
if: matrix.testnet_type == github.event.inputs.testnet_type
uses: docker/setup-buildx-action@v1
- name: 'Login to Azure docker registry'
if: matrix.testnet_type == github.event.inputs.testnet_type
uses: azure/docker-login@v1
with:
login-server: testnetobscuronet.azurecr.io
username: testnetobscuronet
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Login via Azure CLI'
if: matrix.testnet_type == github.event.inputs.testnet_type
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Build and Push Docker Image
if: matrix.testnet_type == github.event.inputs.testnet_type
run: |
DOCKER_BUILDKIT=1 docker build --build-arg GATEWAY_API_URL=${{ matrix.GATEWAY_API_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"
if: matrix.testnet_type == github.event.inputs.testnet_type
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