From 67945aac4a6693db3d3261b87c5daff8bcd1f0b5 Mon Sep 17 00:00:00 2001 From: violine1101 Date: Wed, 4 Sep 2024 18:55:03 +0200 Subject: [PATCH] Workflow: open tunnel in separate step --- .github/workflows/push.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f052f8a..bd8f5ec 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -30,15 +30,26 @@ jobs: wrapper-cache-enabled: true dependencies-cache-enabled: true configuration-cache-enabled: true - - name: Azure Login + - name: Log in to Azure CLI uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - run: | - python3 -m pip install --upgrade pip --user + - name: Open Bastion tunnel + uses: azure/cli@v2 + with: + azcliversion: latest + inlineScript: | az extension add --name bastion + + echo Opening tunnel + az network bastion tunnel --name ${{ secrets.BASTION_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --target-resource-id ${{ secrets.RESOURCE_ID }} --resource-port 22 --port 50022 & + + echo Wait for bastion tunnel to open + az network bastion wait --created --name ${{ secrets.BASTION_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} + - name: Upload build artifacts and run deploy script + run: | ARGS="-avh --delete" USERNAME=risa SERVER_DESTINATION=/home/risa/r-isa @@ -47,13 +58,6 @@ jobs: mkdir -p ~/.ssh echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa - - - echo Opening tunnel - az network bastion tunnel --name ${{ secrets.BASTION_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} --target-resource-id ${{ secrets.RESOURCE_ID }} --resource-port 22 --port 50022 & - - echo Wait for bastion tunnel to open - az network bastion wait --created --name ${{ secrets.BASTION_NAME }} --resource-group ${{ secrets.RESOURCE_GROUP }} echo Upload new libraries FOLDER=build/install/risa/lib