Initial Commit : Convert action to typescript #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run validation on action | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
env: | |
TEST_FULL_ACR_NAME: ${{ vars.TEST_ACR_NAME }}.azurecr.io | |
TEST_IMAGE_REPOSITORY: github-actions/container-app | |
jobs: | |
create-using-builder: | |
name: 'Create app using builder' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_IMAGE_TAG: 'bs-${{ github.run_id }}' | |
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-${{ github.run_id }}' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- 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: | |
appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' | |
acrName: ${{ vars.TEST_ACR_NAME }} | |
acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} | |
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: Delete pushed image | |
if: ${{ always() }} | |
shell: bash | |
run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y | |
create-using-found-dockerfile: | |
name: 'Create app using found Dockerfile' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_IMAGE_TAG: 'fd-${{ github.run_id }}' | |
TEST_CONTAINER_APP_NAME: 'gh-ca-fd-${{ github.run_id }}' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
ref: snehapar/Add-libbrotli-dev | |
- 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: | |
appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' | |
acrName: ${{ vars.TEST_ACR_NAME }} | |
acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} | |
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: Delete pushed image | |
if: ${{ always() }} | |
shell: bash | |
run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y | |
create-using-provided-dockerfile: | |
name: 'Create app using provided Dockerfile' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_IMAGE_TAG: 'pd-${{ github.run_id }}' | |
TEST_CONTAINER_APP_NAME: 'gh-ca-pd-${{ github.run_id }}' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- 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: | |
appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/Blazor_Function_Sample/blazor-sample-app' | |
dockerfilePath: 'Dockerfile' | |
acrName: ${{ vars.TEST_ACR_NAME }} | |
acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} | |
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: Delete pushed image | |
if: ${{ always() }} | |
shell: bash | |
run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y | |
create-using-image-linux: | |
name: 'Create app using image on Linux runner' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'gh-ca-is-lin-${{ github.run_id }}' | |
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: ${{ vars.TEST_EXISTING_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 | |
create-using-image-windows: | |
name: 'Create app using image on Windows runner' | |
runs-on: windows-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'gh-ca-is-win-${{ github.run_id }}' | |
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: ${{ vars.TEST_EXISTING_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 | |
create-using-image-new-env: | |
name: 'Create app using image with new environment' | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
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: | |
name: 'Create app using builder with YAML configuration' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_IMAGE_TAG: 'bs-yaml-${{ github.run_id }}' | |
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-${{ github.run_id }}' | |
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-builder-simple.yaml' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} | |
- name: Update values in YAML configuration file | |
shell: pwsh | |
run: | | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$FULL_ACR_NAME$', '${{ env.TEST_FULL_ACR_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_USERNAME$', '${{ secrets.TEST_REGISTRY_USERNAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$ACR_PASSWORD$', '${{ secrets.TEST_REGISTRY_PASSWORD }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_REPOSITORY$', '${{ env.TEST_IMAGE_REPOSITORY }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$IMAGE_TAG$', '${{ env.TEST_IMAGE_TAG }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
- name: Execute Azure Container Apps Build and Deploy Action | |
uses: ./ | |
with: | |
yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} | |
appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' | |
acrName: ${{ vars.TEST_ACR_NAME }} | |
acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} | |
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: Delete pushed image | |
if: ${{ always() }} | |
shell: bash | |
run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y | |
create-using-image-yaml-linux: | |
name: 'Create app using image with YAML configuration on Linux runner' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-lin-${{ github.run_id }}' | |
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/create-with-image-simple.yaml' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} | |
- name: Update values in YAML configuration file | |
shell: pwsh | |
run: | | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
- name: Execute Azure Container Apps Build and Deploy Action | |
uses: ./ | |
with: | |
yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
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 | |
create-using-image-yaml-windows: | |
name: 'Create app using image with YAML configuration on Windows runner' | |
runs-on: windows-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'gh-ca-bs-yaml-win-${{ github.run_id }}' | |
TEST_YAML_FILE_PATH: 'yaml-samples/create-with-image-simple.yaml' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.TEST_AZURE_CREDENTIALS }} | |
- name: Update values in YAML configuration file | |
shell: pwsh | |
run: | | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
- name: Execute Azure Container Apps Build and Deploy Action | |
uses: ./ | |
with: | |
yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
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 | |
update-using-builder: | |
name: 'Update existing app using builder' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_IMAGE_TAG: 'bs-up-${{ github.run_id }}' | |
TEST_CONTAINER_APP_NAME: 'update-using-builder-app' | |
steps: | |
- name: Checkout action repository | |
uses: actions/checkout@v3 | |
- name: Clone Oryx repository | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/Oryx | |
path: oryx | |
- 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: | |
appSourcePath: '${{ github.workspace }}/oryx/tests/SampleApps/DotNetCore/NetCore6PreviewWebApp' | |
acrName: ${{ vars.TEST_ACR_NAME }} | |
acrUsername: ${{ secrets.TEST_REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.TEST_REGISTRY_PASSWORD }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
containerAppEnvironment: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
imageToBuild: ${{ env.TEST_FULL_ACR_NAME }}/${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} | |
disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} | |
- name: Delete pushed image | |
if: ${{ always() }} | |
shell: bash | |
run: az acr repository delete -n ${{ vars.TEST_ACR_NAME }} -t ${{ env.TEST_IMAGE_REPOSITORY }}:${{ env.TEST_IMAGE_TAG }} -y | |
- name: Update Container App with existing image | |
if: ${{ always() }} | |
shell: bash | |
run: az containerapp update -n ${{ env.TEST_CONTAINER_APP_NAME }} -g ${{ vars.TEST_RESOURCE_GROUP_NAME }} -i mcr.microsoft.com/azuredocs/containerapps-helloworld:latest | |
update-using-image: | |
name: 'Update app using image' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'update-using-image-app' | |
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: ${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} | |
update-using-image-yaml: | |
name: 'Update app using image with YAML configuration' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
TEST_CONTAINER_APP_NAME: 'update-using-image-yaml-app' | |
TEST_YAML_FILE_PATH: '${{ github.workspace }}/yaml-samples/update-with-image-simple.yaml' | |
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: Update values in YAML configuration file | |
shell: pwsh | |
run: | | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$SUBSCRIPTION_ID$', '${{ vars.TEST_SUBSCRIPTION_ID }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$RESOURCE_GROUP$', '${{ vars.TEST_RESOURCE_GROUP_NAME }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
(Get-Content ${{ env.TEST_YAML_FILE_PATH }}).Replace('$CONTAINER_APP_ENV$', '${{ vars.TEST_EXISTING_CONTAINER_APP_ENV }}') | Set-Content ${{ env.TEST_YAML_FILE_PATH }} | |
- name: Execute Azure Container Apps Build and Deploy Action | |
uses: ./ | |
with: | |
yamlConfigPath: ${{ env.TEST_YAML_FILE_PATH }} | |
containerAppName: ${{ env.TEST_CONTAINER_APP_NAME }} | |
resourceGroup: ${{ vars.TEST_RESOURCE_GROUP_NAME }} | |
disableTelemetry: ${{ vars.TEST_DISABLE_TELEMETRY }} |