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

Container App Job Deployment GitHub Action #118

Open
RP-101 opened this issue Nov 11, 2024 · 1 comment
Open

Container App Job Deployment GitHub Action #118

RP-101 opened this issue Nov 11, 2024 · 1 comment

Comments

@RP-101
Copy link

RP-101 commented Nov 11, 2024

Is there a similar action for deploying "Container App Jobs"?

@sagarneeldubey
Copy link

I was also looking for such an action for deploying container app jobs, but couldn't find one. I ended up writing a run command that deploys a pre-built image (which was done in a previous step) using az cli command. Sample workflow snippet given below. The CLI command is under the step named Deploy to Azure Container App Jobs

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository under GITHUB WORKSPACE ${{ github.sha }}
        uses: actions/checkout@v3
      - name: Login to Azure Container Registry and build-push docker image
        uses: azure/docker-login@v1
        with:
          login-server: ${{ env.ACR_NAME }}.azurecr.io
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}
      - run: |
          docker build . -t ${{ env.ACR_NAME }}.azurecr.io/${{ env.IMAGE }}:${{ github.sha }}
          docker push ${{ env.ACR_NAME }}.azurecr.io/${{ env.IMAGE }}:${{ github.sha }}

  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Log in to Azure
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: Login to Azure Container Registry
        uses: azure/docker-login@v1
        with:
          login-server: ${{ env.ACR_NAME }}.azurecr.io
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}

      - name: Deploy to Azure Container App Jobs
        run: |
          az containerapp job update --name ${{ env.CONTAINER_APP }} \
          --resource-group ${{ env.RESOURCE_GROUP }} \
          --image ${{ env.ACR_NAME }}.azurecr.io/${{ env.IMAGE }}:${{ github.sha }}

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

2 participants