Skip to content

Add Argo CronWorkflow for scheduled processing #5

Add Argo CronWorkflow for scheduled processing

Add Argo CronWorkflow for scheduled processing #5

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set version
run: echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
run: |
docker build \
-t infrascielo/processing:${VERSION} \
-t infrascielo/processing:latest \
.
# 馃攼 Scan 煤nico (policy)
- name: Trivy Image Scan
uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: infrascielo/processing:${{ env.VERSION }}
severity: HIGH,CRITICAL
exit-code: 0
- name: Install Trivy CLI
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sudo sh -s -- -b /usr/local/bin
# 馃搫 Relat贸rio (evid锚ncia)
- name: Trivy Report
run: |
trivy image \
--scanners vuln \
--severity HIGH,CRITICAL \
--format table \
--output trivy-report.txt \
infrascielo/processing:${VERSION}
- uses: actions/upload-artifact@v4
with:
name: trivy-report
path: trivy-report.txt
# 馃摝 SBOM
- name: Generate SBOM (CycloneDX)
run: |
trivy image \
--scanners vuln \
--format cyclonedx \
--output sbom-${VERSION}.json \
infrascielo/processing:${VERSION}
- uses: actions/upload-artifact@v4
with:
name: sbom-${{ env.VERSION }}
path: sbom-${{ env.VERSION }}.json
- name: Push image
run: |
docker push infrascielo/processing:${VERSION}
docker push infrascielo/processing:latest
- name: Push image
run: |
docker push infrascielo/processing:${VERSION}
docker push infrascielo/processing:latest
- name: Get image digest
run: |
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' infrascielo/processing:${VERSION})
echo "IMAGE_DIGEST=${DIGEST}" >> $GITHUB_ENV
- name: Install Cosign
uses: sigstore/cosign-installer@v3
- name: Sign image with Cosign
env:
COSIGN_EXPERIMENTAL: "1"
COSIGN_YES: "true"
run: |
cosign sign ${IMAGE_DIGEST}
- name: Verify image signature
env:
COSIGN_EXPERIMENTAL: "1"
run: |
cosign verify \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp "https://github.com/${{ github.repository }}/*" \
${IMAGE_DIGEST}
- name: Attach SBOM attestation
env:
COSIGN_EXPERIMENTAL: "1"
COSIGN_YES: "true"
run: |
cosign attest \
--predicate sbom-${VERSION}.json \
--type cyclonedx \
${IMAGE_DIGEST}