Skip to content

Update dm-verity as a separate layer #1

Update dm-verity as a separate layer

Update dm-verity as a separate layer #1

name: Push Attestation Image
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- .github/workflows/push_attestation_image.yml
- cmd/attestation-container/**
- docker/attestation-container/**
- pkg/attest
- pkg/common
- vendor/**
- internal/**
push:
branches:
- main
paths:
- .github/workflows/push_attestation_image.yml
- cmd/attestation-container/**
- docker/attestation-container/**
- pkg/attest
- pkg/common
- vendor/**
- internal/**
jobs:
push-attestation-image:
name: Push Attestation Image
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Azure Container Registry
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_NAME }}.${{ secrets.REGISTRY_DOMAIN }}
username: ${{ secrets.REGISTRY_NAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Get Image Tag
id: get_image_tag
run: |
if [ ${{ github.event_name }} == "push" ]; then
branch_name=main
elif [ ${{ github.event_name }} == "workflow_dispatch" ]; then
branch_name=${{ github.ref }}
branch_name=${branch_name:11}
else
branch_name=${{ github.head_ref }}
fi
echo "image_tag=$(echo ${branch_name:0:128} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
file: docker/attestation-container/Dockerfile.run
push: true
tags: |
${{ secrets.REGISTRY_NAME }}.${{ secrets.REGISTRY_DOMAIN }}/attestation:${{ steps.get_image_tag.outputs.image_tag }}