Skip to content

Merge pull request #59 from Azure/aaqib-m/fix-cve #15

Merge pull request #59 from Azure/aaqib-m/fix-cve

Merge pull request #59 from Azure/aaqib-m/fix-cve #15

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
releaseTag:
description: "Release tag to publish"
type: string
required: true
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Get image metadata
id: get_metadata
run: |
if [ "${{ github.event_name }}" == "push" ]; then
IMG_TAG="${{ github.ref_name }}"
else
IMG_TAG=${{ github.event.inputs.releaseTag }}
fi
IMG="public/aks/msi-acrpull:${IMG_TAG}"
echo "IMG_TAG=${IMG_TAG}" >> ${GITHUB_OUTPUT}
echo "IMG=${IMG}" >> ${GITHUB_OUTPUT}
outputs:
IMG_TAG: ${{ steps.get_metadata.outputs.IMG_TAG }}
IMG: ${{ steps.get_metadata.outputs.IMG }}
publish:
runs-on:
labels: ["self-hosted", "1ES.Pool=${{ vars.RUNNER_BASE_NAME}}-ubuntu"]
needs: setup
env:
IMG: ${{ secrets.AZURE_CONTAINER_REGISTRY }}/${{ needs.setup.outputs.IMG }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Build the Docker image
run: make docker-build
- name: Run vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.IMG }}
format: table
- name: Azure Container Registry Login
run: |
az login --identity -o none
az acr login -n ${{ secrets.AZURE_CONTAINER_REGISTRY }}
- name: Push to CI ACR
run: make docker-push