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

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

Open
philipbTC opened this issue May 22, 2024 · 0 comments

Comments

@philipbTC
Copy link

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.

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

1 participant