Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide output from 'az containerapp' commands #65

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ runs:
run: |
az group show \
-n ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-o none && CA_GH_ACTION_RG_EXISTS=true || CA_GH_ACTION_RG_EXISTS=false
--output none && CA_GH_ACTION_RG_EXISTS=true || CA_GH_ACTION_RG_EXISTS=false
echo "CA_GH_ACTION_RG_EXISTS=${CA_GH_ACTION_RG_EXISTS}" >> $GITHUB_ENV

- name: Get default location for Container Apps to use if resource group doesn't exist and location wasn't provided
Expand Down Expand Up @@ -344,7 +344,7 @@ runs:
az containerapp show \
-g ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-n ${{ inputs.containerAppName }} \
-o none && CA_GH_ACTION_RESOURCE_EXISTS=true || CA_GH_ACTION_RESOURCE_EXISTS=false
--output && CA_GH_ACTION_RESOURCE_EXISTS=true || CA_GH_ACTION_RESOURCE_EXISTS=false
echo "CA_GH_ACTION_RESOURCE_EXISTS=${CA_GH_ACTION_RESOURCE_EXISTS}" >> $GITHUB_ENV

- name: Export environment to environment variable
Expand All @@ -368,7 +368,7 @@ runs:
az containerapp env show \
-g ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-n ${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT }} \
-o none && CA_GH_ACTION_ENVIRONMENT_EXISTS=true || CA_GH_ACTION_ENVIRONMENT_EXISTS=false
--output none && CA_GH_ACTION_ENVIRONMENT_EXISTS=true || CA_GH_ACTION_ENVIRONMENT_EXISTS=false
echo "CA_GH_ACTION_ENVIRONMENT_EXISTS=${CA_GH_ACTION_ENVIRONMENT_EXISTS}" >> $GITHUB_ENV

- name: Reuse an existing Container App environment if found in the resource group
Expand Down Expand Up @@ -588,7 +588,8 @@ runs:
az containerapp create \
-g ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-n ${{ inputs.containerAppName }} \
--yaml ${{ inputs.yamlConfigPath }}
--yaml ${{ inputs.yamlConfigPath }} \
--output none

- name: Create the Container App from provided arguments
if: ${{ env.CA_GH_ACTION_YAML_PROVIDED != 'true' && env.CA_GH_ACTION_RESOURCE_EXISTS == 'false' }}
Expand All @@ -602,7 +603,8 @@ runs:
${{ env.CA_GH_ACTION_INGRESS_ARG }} \
${{ env.CA_GH_ACTION_TARGET_PORT_ARG }} \
${{ env.CA_GH_ACTION_REGISTRY_LOGIN_ARG }} \
${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT_VARIABLES_ARG }}
${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT_VARIABLES_ARG }} \
--output none

- name: Update the existing Container App from a YAML configuration file
if: ${{ env.CA_GH_ACTION_YAML_PROVIDED == 'true' && env.CA_GH_ACTION_RESOURCE_EXISTS == 'true' }}
Expand All @@ -611,7 +613,8 @@ runs:
az containerapp update \
-g ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-n ${{ inputs.containerAppName }} \
--yaml ${{ inputs.yamlConfigPath }}
--yaml ${{ inputs.yamlConfigPath }} \
--output none

- name: Determine whether or not 'update' or 'up' should be used
if: ${{ env.CA_GH_ACTION_YAML_PROVIDED != 'true' && env.CA_GH_ACTION_RESOURCE_EXISTS == 'true' && (inputs.targetPort != '' || inputs.ingress != '') }}
Expand Down Expand Up @@ -639,7 +642,8 @@ runs:
-g ${{ env.CA_GH_ACTION_RESOURCE_GROUP }} \
-n ${{ inputs.containerAppName }} \
-i ${{ env.CA_GH_ACTION_IMAGE_TO_DEPLOY }} \
${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT_VARIABLES_ARG }}
${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT_VARIABLES_ARG }} \
--output none

- name: Reset the ingress argument environment variable if it wasn't provided (use default ingress value)
if: ${{ inputs.ingress == '' && env.CA_GH_ACTION_YAML_PROVIDED != 'true' && env.CA_GH_ACTION_RESOURCE_EXISTS == 'true' }}
Expand All @@ -666,7 +670,8 @@ runs:
${{ env.CA_GH_ACTION_TARGET_PORT_ARG }} \
${{ env.CA_GH_ACTION_INGRESS_ARG }} \
${{ env.CA_GH_ACTION_CONTAINER_APP_ENVIRONMENT_VARIABLES_ARG }} \
${{ env.CA_GH_ACTION_REGISTRY_LOGIN_ARG }}
${{ env.CA_GH_ACTION_REGISTRY_LOGIN_ARG }} \
--output none

- name: Disable ingress on the existing Container App
if: ${{ env.CA_GH_ACTION_RESOURCE_EXISTS == 'true' && inputs.ingress == 'disabled' && env.CA_GH_ACTION_YAML_PROVIDED != 'true' }}
Expand Down
Loading