Skip to content

Commit

Permalink
github actions fix for dexynth gateway (#2076)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj authored Oct 4, 2024
1 parent f6b6c73 commit 31a932e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/manual-deploy-obscuro-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# - GATEWAY_MAX_CONCURRENT_REQUESTS_PER_USER

# If we are deploying to a non primary instance all those variables should be prefixed with the instance name
# example: dexynth-DOCKER_BUILD_TAG_GATEWAY
# example: DEXYNTH_DOCKER_BUILD_TAG_GATEWAY


name: '[M] Deploy Ten Gateway Backend'
Expand All @@ -34,15 +34,15 @@ on:
type: choice
options:
- "primary"
- "dexynth"
- "DEXYNTH"

jobs:
validate-inputs:
runs-on: ubuntu-latest
steps:
- name: "Check if deployment is allowed"
run: |
if [[ "${{ github.event.inputs.instance_type }}" == "Dexynth" && "${{ github.event.inputs.testnet_type }}" != "sepolia-testnet" ]]; then
if [[ "${{ github.event.inputs.instance_type }}" == "DEXYNTH" && "${{ github.event.inputs.testnet_type }}" != "sepolia-testnet" ]]; then
echo "Error: Dexynth can only be deployed to sepolia-testnet."
exit 1
fi
Expand All @@ -60,15 +60,16 @@ jobs:
if [[ "${{ github.event.inputs.instance_type }}" != "primary" ]]; then
INSTANCE_SUFFIX="_${{ github.event.inputs.instance_type }}"
INSTANCE_SUFFIX2="-${{ github.event.inputs.instance_type }}"
INSTANCE_PREFIX="${{ github.event.inputs.instance_type }}_"
fi
echo "INSTANCE_SUFFIX=$INSTANCE_SUFFIX" >> $GITHUB_ENV
echo "INSTANCE_PREFIX=$INSTANCE_PREFIX" >> $GITHUB_ENV
# Set infrastructure variables
PUBLIC_IP="${{ github.event.inputs.testnet_type }}-OG-static${INSTANCE_SUFFIX}"
DNS_NAME="obscurogateway-${{ github.event.inputs.testnet_type }}${INSTANCE_SUFFIX}"
PUBLIC_IP="${{ github.event.inputs.testnet_type }}-OG-static${INSTANCE_SUFFIX2,,}"
DNS_NAME="obscurogateway-${{ github.event.inputs.testnet_type }}${INSTANCE_SUFFIX2,,}"
VM_NAME="${{ github.event.inputs.testnet_type }}-OG-${{ github.run_number }}${INSTANCE_SUFFIX}"
DEPLOY_GROUP="ObscuroGateway-${{ github.event.inputs.testnet_type }}-${{ github.run_number }}${INSTANCE_SUFFIX}"
VNET_NAME="ObscuroGateway-${{ github.event.inputs.testnet_type }}-01VNET${INSTANCE_SUFFIX}"
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/manual-deploy-ten-gateway-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# - TENSCAN_URL

# If we are deploying to a non primary instance all those variables should be prefixed with the instance name
# example: dexynth-GATEWAY_URL
# example: DEXYNTH_GATEWAY_URL

name: '[M] Deploy Ten Gateway Frontend'
run-name: '[M] Deploy Ten Gateway Frontend ( ${{ github.event.inputs.testnet_type }} )'
Expand All @@ -30,14 +30,14 @@ on:
type: choice
options:
- "primary"
- "dexynth"
- "DEXYNTH"
jobs:
validate-inputs:
runs-on: ubuntu-latest
steps:
- name: "Check if deployment is allowed"
run: |
if [[ "${{ github.event.inputs.instance_type }}" == "dexynth" && "${{ github.event.inputs.testnet_type }}" != "sepolia-testnet" ]]; then
if [[ "${{ github.event.inputs.instance_type }}" == "DEXYNTH" && "${{ github.event.inputs.testnet_type }}" != "sepolia-testnet" ]]; then
echo "Error: Dexynth can only be deployed to sepolia-testnet."
exit 1
fi
Expand All @@ -53,16 +53,17 @@ jobs:
INSTANCE_PREFIX=""
if [[ "${{ github.event.inputs.instance_type }}" != "primary" ]]; then
INSTANCE_SUFFIX="-${{ github.event.inputs.instance_type }}"
INSTANCE_PREFIX="${{ github.event.inputs.instance_type }}-"
INSTANCE_SUFFIX="_${{ github.event.inputs.instance_type }}"
INSTANCE_SUFFIX2="-${{ github.event.inputs.instance_type }}"
INSTANCE_PREFIX="${{ github.event.inputs.instance_type }}_"
fi
echo "INSTANCE_SUFFIX=$INSTANCE_SUFFIX" >> $GITHUB_ENV
echo "INSTANCE_PREFIX=$INSTANCE_PREFIX" >> $GITHUB_ENV
DNS_NAME_LABEL_GATEWAY_FE="${{ github.event.inputs.testnet_type }}-ten-gateway${INSTANCE_SUFFIX}"
IMAGE_NAME_GATEWAY_FE="${{ github.event.inputs.testnet_type }}-fe-ten-gateway${INSTANCE_SUFFIX}"
DNS_NAME_LABEL_GATEWAY_FE="${{ github.event.inputs.testnet_type }}-ten-gateway${INSTANCE_SUFFIX2,,}"
IMAGE_NAME_GATEWAY_FE="${{ github.event.inputs.testnet_type }}-fe-ten-gateway${INSTANCE_SUFFIX2,,}"
echo "DNS_NAME_LABEL_GATEWAY_FE=$DNS_NAME_LABEL_GATEWAY_FE" >> $GITHUB_ENV
echo "IMAGE_NAME_GATEWAY_FE=$IMAGE_NAME_GATEWAY_FE" >> $GITHUB_ENV
Expand Down Expand Up @@ -122,12 +123,12 @@ jobs:
- name: 'Build and Push Docker Image'
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg NEXT_PUBLIC_NETWORK_NAME=${{ env.NETWORK_NAME }} \
--build-arg NEXT_PUBLIC_TENSCAN_URL=${{ env.TENSCAN_URL }} \
--build-arg NEXT_PUBLIC_GATEWAY_URL=${{ env.GATEWAY_URL }} \
-t ${{ env.DOCKER_BUILD_TAG_GATEWAY_FE }} \
--build-arg NEXT_PUBLIC_NETWORK_NAME="${{ env.NETWORK_NAME }}" \
--build-arg NEXT_PUBLIC_TENSCAN_URL="${{ env.TENSCAN_URL }}" \
--build-arg NEXT_PUBLIC_GATEWAY_URL="${{ env.GATEWAY_URL }}" \
-t "${{ env.DOCKER_BUILD_TAG_GATEWAY_FE }}" \
-f ./tools/walletextension/frontend/Dockerfile .
docker push ${{ env.DOCKER_BUILD_TAG_GATEWAY_FE }}
docker push "${{ env.DOCKER_BUILD_TAG_GATEWAY_FE }}"
- name: 'Deploy Gateway FE to Azure Container Instances'
uses: "azure/aci-deploy@v1"
Expand Down

0 comments on commit 31a932e

Please sign in to comment.