Skip to content

Commit

Permalink
Improve github action
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkma committed Apr 29, 2024
1 parent 45e3848 commit 9f4eb4b
Showing 1 changed file with 57 additions and 57 deletions.
114 changes: 57 additions & 57 deletions .github/workflows/run-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,62 +268,62 @@ jobs:
shell: bash
run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y

create-using-image-new-env:

name: 'Create app using image with new environment'
runs-on: ubuntu-latest
timeout-minutes: 25

env:
TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}'
TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env'

steps:
- name: Checkout action repository
uses: actions/checkout@v3

- name: Log in to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.TEST_AZURE_CREDENTIALS }}

- name: Execute Azure Container Apps Build and Deploy Action
uses: ./
with:
imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest'
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }}
containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }}
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }}
disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }}

- name: Delete created Azure Container App
if: ${{ always() }}
shell: bash
run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y

- name: Get customer ID for workspace to delete
if: ${{ always() }}
shell: bash
run: |
CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId')
echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV
- name: Get name of workspace to delete
if: ${{ always() }}
shell: bash
run: |
WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]')
echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV
- name: Delete created Azure Container App environment
if: ${{ always() }}
shell: bash
run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y

- name: Delete created workspace
if: ${{ always() }}
shell: bash
run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y
# create-using-image-new-env:

# name: 'Create app using image with new environment'
# runs-on: ubuntu-latest
# timeout-minutes: 25

# env:
# TEST_CONTAINER_APP_NAME: 'gh-ca-is-ne-${{ github.run_id }}'
# TEST_NEW_CONTAINER_APP_ENV: 'gh-ca-is-ne-${{ github.run_id }}-env'

# steps:
# - name: Checkout action repository
# uses: actions/checkout@v3

# - name: Log in to Azure
# uses: azure/login@v1
# with:
# creds: ${{ secrets.TEST_AZURE_CREDENTIALS }}

# - name: Execute Azure Container Apps Build and Deploy Action
# uses: ./
# with:
# imageToDeploy: 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest'
# containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }}
# containerAppEnvironment: ${{ env.TEST_NEW_CONTAINER_APP_ENV }}
# resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }}
# disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }}

# - name: Delete created Azure Container App
# if: ${{ always() }}
# shell: bash
# run: az containerapp delete -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -y

# - name: Get customer ID for workspace to delete
# if: ${{ always() }}
# shell: bash
# run: |
# CUSTOMER_ID=$(az containerapp env show -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} --query 'properties.appLogsConfiguration.logAnalyticsConfiguration.customerId')
# echo "CUSTOMER_ID=${CUSTOMER_ID}" >> $GITHUB_ENV

# - name: Get name of workspace to delete
# if: ${{ always() }}
# shell: bash
# run: |
# WORKSPACE_NAME=$(az monitor log-analytics workspace list -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} --query '[?customerId == `${{ env.CUSTOMER_ID }}`].name | [0]')
# echo "WORKSPACE_NAME=${WORKSPACE_NAME}" >> $GITHUB_ENV

# - name: Delete created Azure Container App environment
# if: ${{ always() }}
# shell: bash
# run: az containerapp env delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.TEST_NEW_CONTAINER_APP_ENV }} -y

# - name: Delete created workspace
# if: ${{ always() }}
# shell: bash
# run: az monitor log-analytics workspace delete -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -n ${{ env.WORKSPACE_NAME }} -y

create-using-builder-yaml:

Expand Down Expand Up @@ -625,7 +625,7 @@ jobs:

create-using-builder-with-add-on:

name: 'Create app using builder'
name: 'Create app using builder with add-on services'
runs-on: ubuntu-latest
timeout-minutes: 10

Expand Down

0 comments on commit 9f4eb4b

Please sign in to comment.