Azure / Azure/container-apps-deploy-action

Deploy action always tries to build docker image despite specify an existing image in registry

Open
#109 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
94
Forks
51
Avg merge
4d 18h
Merged PRs (30d)
1

Description

Hi,

I'm trying to deploy a Spring boot API which is built using google JIB. The JIB plugin is also sucessfully pushing my image to the ACR. However the deploy action seems to be also trying to build its own image. If I have read the documentation correctly this should not be the case given my yml:

```
name: Trigger auto deployment for availability-service

# When this action will be executed
on:
# Automatically trigger it when detected changes in repo
push:
branches:
[ main ]
paths:
- '**'
- '.github/workflows/availability-service-AutoDeployTrigger-6a25879c-40df-4a82-adb9-2c29787213d4.yml'

# Allow manual trigger
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write #This is required for requesting the OIDC JWT Token
contents: read #Required when GH token is used to authenticate with private repo

steps:
- name: Checkout to the branch
uses: actions/checkout@v2

- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AVAILABILITYSERVICE_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AVAILABILITYSERVICE_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AVAILABILITYSERVICE_AZURE_SUBSCRIPTION_ID }}

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Custom build step using Gradle Jib
- name: Build and push container image to registry
run: |
./gradlew jib \
-Djib.to.auth.username=${{ secrets.AVAILABILITYSERVICE_REGISTRY_USERNAME }} \
-Djib.to.auth.password=${{ secrets.AVAILABILITYSERVICE_REGISTRY_PASSWORD }} \
-Djib.to.image=testtechcontainerregistry.azurecr.io/availability-service:${{ github.sha }}

- name: Build and push container image to registry
uses: azure/container-apps-deploy-action@v2
with:
registryUrl: testtechcontainerregistry.azurecr.io
registryUsername: ${{ secrets.AVAILABILITYSERVICE_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.AVAILABILITYSERVICE_REGISTRY_PASSWORD }}
containerAppName: availability-service
resourceGroup: test-tech-us
imageToDeploy: testtechcontainerregistry.azurecr.io/availability-service:${{ github.sha }}

```
I would appriciate any assistance with this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the azure/container-apps-deploy-action@v2 entry point and compare its handling of registryUrl and imageToDeploy in the supplied workflow. Verify whether an explicitly provided JIB-pushed image is deployed without triggering another build, and confirm the action still deploys the exact image tag shown in the workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions, java, spring-boot, typescript
Domain
ci-cd, cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.