Skip to content

Commit

Permalink
New test workflow for 1es runner. (#284)
Browse files Browse the repository at this point in the history
Co-authored-by: Tatsat Mishra <tatsat.mishra@microsoft.com>
  • Loading branch information
Tatsinnit and Tatsat Mishra authored Feb 9, 2024
1 parent 5676639 commit e3a5baf
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-publish-poc-1es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Building and Pushing to MCR
on: [workflow_dispatch]

permissions:
id-token: write
contents: read

jobs:
common:
runs-on:
labels: ["self-hosted", "1ES.Pool=1es-aks-periscope-pool-msit-poc"]
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v3
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
path: ./CHANGELOG.md
- name: Get Version Info
id: read_metadata
run: |
echo "Version: ${{ steps.changelog_reader.outputs.version }}"
echo "Changes: ${{ steps.changelog_reader.outputs.changes }}"
$tagbase = "${{ vars.AZURE_REGISTRY_SERVER }}/periscope-test:${{ steps.changelog_reader.outputs.version }}"
echo "tagbase=$tagbase" >> $env:GITHUB_OUTPUT
outputs:
tagbase: ${{ steps.read_metadata.outputs.tagbase }}
version: ${{ steps.changelog_reader.outputs.version }}
changes: ${{ steps.changelog_reader.outputs.changes }}
publish:
runs-on:
labels: ["self-hosted", "1ES.Pool=1es-aks-periscope-pool-msit-poc"]
needs: common
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v3
# - name: 'Az CLI login'
- name: "Login to ACR"
run: |
az login --identity
- name: 'Publish to ACR'
id: publish
run: |
$tag = "${{ needs.common.outputs.tagbase }}-mariner2.0"
echo "tag-ubuntu-latest=$tag" >> $env:GITHUB_OUTPUT
docker build -f ./builder/Dockerfile.linux --build-arg BASE_IMAGE=mcr.microsoft.com/cbl-mariner/distroless/base:2.0 -t $tag .
az acr login -n ${{ vars.AZURE_REGISTRY_SERVER }}
docker push $tag
outputs:
linux: ${{ steps.publish.outputs.tag-ubuntu-latest }}

0 comments on commit e3a5baf

Please sign in to comment.