name: ~Build container template on: workflow_call: inputs: image-name: required: true type: string description: "The name of the image to build" dockerfile: required: true type: string runner: required: false default: nemo-ci-aws-gpu-x2 type: string description: "The runner to use for the build" registry: required: false default: 766267172432.dkr.ecr.us-east-1.amazonaws.com type: string description: "Container registry" outputs: image: description: "Full image URL (registry/nemo-speech:image-name-run_id)" value: ${{ jobs.build.outputs.image }} permissions: id-token: write contents: read jobs: pre-flight: runs-on: ubuntu-latest outputs: build_args: ${{ steps.manifest.outputs.BUILD_ARGS }} cache-from: ${{ steps.cache_from.outputs.LAST_PRS }} steps: - name: Checkout repository uses: actions/checkout@v6 - name: Get last merged PR id: cache_from env: GH_TOKEN: ${{ github.token }} run: | LAST_PRS=$(gh api graphql -f query=' query { repository(owner: "NVIDIA", name: "NeMo") { pullRequests(states: MERGED, first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number } } } }' | jq -r '.data.repository.pullRequests.nodes[].number' | while read -r number; do echo "type=registry,ref=${{ inputs.registry }}/nemo-speech:${{ inputs.image-name }}-buildcache-$number,mode=max" done) echo "LAST_PRS<