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

using imageToDeploy with a latest tag does not update revision #57

Open
rodyvansambeek opened this issue Sep 2, 2023 · 8 comments
Open

Comments

@rodyvansambeek
Copy link

I want to use this action to deploy "an already pushed application image".

In the CI/CD pipeline I create and push the image to the repository with the latest tag. However, when I specify the imageToDeploy parameter as: registry/image:latest everything works fine, however it will not create a new revision. The old revision stays online, until a new container is spinned up by a ACA scaling rule.

Is this a design choice? For now I am using specific version numbers as tags, which works. But I would like to be able to use a latest tag, which represents the currently running version.

@Panetes
Copy link

Panetes commented Oct 11, 2023

+1 Having this exact problem. Did you find a solution for this?

@dworak-dev
Copy link

+1

@FAbrahamDev
Copy link

We use:

        - name: Build and push
          uses: docker/build-push-action@v4
          with:
            context: ""
            push: true
            tags: ${{ secrets.PROD_REGISTRY_LOGIN_SERVER }}/${{ secrets.PROD_CONTAINER_APP_BACKEND }}:latest,${{ secrets.PROD_REGISTRY_LOGIN_SERVER }}/${{ secrets.PROD_CONTAINER_APP_BACKEND }}:${{ steps.vars.outputs.sha_short }}
            cache-from: type=gha
            cache-to: type=gha,mode=max

which creates two registry entries.

@fareshan
Copy link

+1
This works with azure app services. I don't understand why it does not work with container apps.
Any solution ?

@fareshan
Copy link

This is an important feature in order to be able to manage container apps with Terraform.
My workaround for now is to add:

  lifecycle {
    # we can not set the image tag to latest in github workflows, so we need to ignore the image in the lifecycle
    # https://github.com/Azure/container-apps-deploy-action/issues/57
    ignore_changes = [template[0].container[0].image]
  }

in the terraform ressource

@waseemw
Copy link

waseemw commented May 17, 2024

As a workaround you can use revision copy at the end in an extra step:

- name: Azure CLI script
  uses: azure/cli@v2
  env:
    containerAppName: CopyFromPreviousStep
    resourceGroup: CopyFromPreviousStep
  with:
    azcliversion: latest
    inlineScript: |
      az containerapp revision copy -n ${{ env.containerAppName }} \
      -g ${{ env.resourceGroup }} --revision-suffix ${{ github.run_id }}-${{ github.run_attempt }}

I added --revision-suffix because the revision has to be different than the previous one in order to redeploy, so I used workflow run id and attempt #

@tux2nicolae
Copy link

We have the same issue, lost a few hours investigating this

@rodyvansambeek
Copy link
Author

In the end I actually ended up tagging the container with their own version number by using Gitversion and the 'latest' tag, and just using the latest version in the ACA deploy step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants