Skip to content

Remove: fluxcd

Remove: fluxcd #87

Workflow file for this run

name: Build-Publish-Deploy
on:
push:
branches:
- main
env:
tag: v0.1.0-alpha
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Login to Azure Container Registry
run: |
az acr login --name ${{ vars.ACR_NAME }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ vars.ACR_NAME }}.azurecr.io/azure-voting-app-rust:${{ env.tag }}
- name: Aqua Security Trivy Scan
uses: aquasecurity/[email protected]
with:
image-ref: ${{ vars.ACR_NAME }}.azurecr.io/azure-voting-app-rust:${{ env.tag }}
format: json
output: patch.json
vuln-type: os
exit-code: 0
ignore-unfixed: true
severity: CRITICAL
- name: Patch with Copacetic
run: |
function download() {
DOWNLOAD_URL=$1
DOWNLOAD_FILE=$2
curl -L -o $DOWNLOAD_FILE $DOWNLOAD_URL
tar -xzf $DOWNLOAD_FILE
rm $DOWNLOAD_FILE
}
download https://github.com/project-copacetic/copacetic/releases/download/v0.2.0/copa_0.2.0_linux_amd64.tar.gz copa_0.2.0_linux_amd64.tar.gz
download https://github.com/moby/buildkit/releases/download/v0.11.6/buildkit-v0.11.6.linux-amd64.tar.gz buildkit-v0.11.6.linux-amd64.tar.gz
pushd ./bin
sudo nohup ./buildkitd &
popd
sleep 5
sudo ./copa patch -i ${{ vars.ACR_NAME }}.azurecr.io/azure-voting-app-rust:${{ env.tag }} -r patch.json -t ${{ env.tag }}
- name: Push patched Docker image
id: img
run: |
echo "DIGEST=$(docker push ${{ vars.ACR_NAME }}.azurecr.io/azure-voting-app-rust:${{ env.tag }} | grep -oE 'sha256:[a-f0-9]{64}')" >> $GITHUB_OUTPUT
- name: Setup Notation
uses: notaryproject/notation-action/setup@v1
with:
version: "1.0.0"
- name: Notation Sign
uses: notaryproject/notation-action/sign@v1
with:
plugin_name: azure-kv
plugin_url: https://github.com/Azure/notation-azure-kv/releases/download/v1.0.1/notation-azure-kv_1.0.1_linux_amd64.tar.gz
plugin_checksum: f8a75d9234db90069d9eb5660e5374820edf36d710bd063f4ef81e7063d3810b
key_id: ${{ vars.KEY_ID }}
target_artifact_reference: ${{ vars.ACR_NAME }}.azurecr.io/azure-voting-app-rust@${{ steps.img.outputs.DIGEST }}
signature_format: cose
plugin_config: |-
name=${{ vars.CERT_NAME }}
self_signed=false