Skip to content

5.0.0-dev17

5.0.0-dev17 #296

Workflow file for this run

name: "Build and Publish Release Containers to MCR"
on:
release:
types: [published]
env:
ACR_REGISTRY: ccfmsrc.azurecr.io
ACR_TOKEN_NAME: app-push-token
DOCKER_BUILDKIT: 1 # https://docs.docker.com/develop/develop-images/build_enhancements/
permissions: read-all
jobs:
build_and_publish:
name: "Build & push"
runs-on: ubuntu-latest
strategy:
matrix:
platform: [sgx, virtual, snp]
type: [dev, run]
run_js: [true, ""]
clang_version: ["11", "15"]
exclude:
- type: dev
run_js: true
- platform: sgx
clang_version: "15"
- platform: virtual
clang_version: "11"
- platform: snp
clang_version: "11"
steps:
- uses: actions/checkout@v4
- name: Get image tag from git tag (release) or latest (branch)
run: |
echo "tag=${GITHUB_REF#refs/tags/ccf-}" >> $GITHUB_OUTPUT
id: tref
- name: Build ${{ matrix.type }} container for ${{ matrix.platform }}${{ matrix.run_js && ', (JS)' || '' }} using clang ${{ matrix.clang_version }}
run: docker build -f docker/app_${{ matrix.type }} . --build-arg="clang_version=${{ matrix.clang_version }}" --build-arg="platform=${{ matrix.platform }}" --build-arg="ansible_vars=ccf_ver=${{ steps.tref.outputs.tag }} ${{ matrix.run_js && 'run_js=true' || '' }}" -t $ACR_REGISTRY/public/ccf/app/${{ matrix.type }}${{ matrix.run_js && '-js' || '' }}:${{ steps.tref.outputs.tag }}-${{ matrix.platform }}
- name: Log in
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_APP_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY
- name: Push App container
run: docker push $ACR_REGISTRY/public/ccf/app/${{ matrix.type }}${{ matrix.run_js && '-js' || '' }}:${{ steps.tref.outputs.tag }}-${{ matrix.platform }}