Skip to content

Build SNP CI Testing CCF Container #131

Build SNP CI Testing CCF Container

Build SNP CI Testing CCF Container #131

name: "Build SNP CI Testing CCF Container"
on:
workflow_dispatch:
pull_request_target:
branches:
- main
- release/3.x
paths:
- scripts/azure_deployment/*
- .github/workflows/build-ci-container.yml
- .azure_pipelines_snp.yml
- .azure-pipelines-templates/deploy_aci.yml
- .azure-pipelines-templates/test_on_remote.yml
- .snpcc_canary
push:
branches:
- main
- release/3.x
schedule:
- cron: "0 9 * * Mon-Fri"
env:
ACR_REGISTRY: ccfmsrc.azurecr.io
ACR_TOKEN_NAME: ci-push-token
jobs:
build:
name: "Build and Publish Pre-built SNP Container"
runs-on: [self-hosted, 1ES.Pool=ccf-ci-github]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Debug
run: |
df -kh
sudo mkdir -p /etc/docker
sudo echo '{"data-root": "/mnt"}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: Log in
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_CI_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY
- name: Pull CI container
run: docker pull $ACR_REGISTRY/ccf/ci:27-04-2023-snp-clang15
- name: Build CCF CI SNP container
run: docker build -f docker/ccf_ci_built . --build-arg="base=ccfmsrc.azurecr.io/ccf/ci:27-04-2023-snp-clang15" --build-arg="platform=snp" -t $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`
- name: Push CI container
run: docker push $ACR_REGISTRY/ccf/ci:pr-`git rev-parse HEAD`