dist: bump Syft to 1.19.0 #237
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-binaries: | |
permissions: | |
id-token: write # for AWS OIDC | |
strategy: | |
matrix: | |
include: | |
- runner: buildjet-4vcpu-ubuntu-2204 | |
arch: amd64 | |
- runner: buildjet-4vcpu-ubuntu-2204-arm | |
arch: arm64 | |
runs-on: ${{ matrix.runner }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Authenticate to AWS | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::970625735569:role/GitHubActionsECRPush | |
- name: Configure AWS Docker Auth | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
uses: aws-actions/amazon-ecr-login@v1 | |
with: | |
mask-password: true | |
registry-type: public | |
- name: Building builder image | |
id: build-buildier | |
uses: docker/build-push-action@v3 | |
with: | |
context: build/ | |
push: false | |
tags: agent-builder:latest | |
- name: Generate Image Metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
public.ecr.aws/edgebit/edgebit-agent | |
tags: | | |
type=ref,event=pr,suffix=-${{ matrix.arch }} | |
flavor: | | |
latest=false | |
- name: Building agent | |
id: build-agent | |
uses: docker/build-push-action@v3 | |
with: | |
push: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Generate SBOM from the container | |
if: ${{ matrix.arch == 'amd64' }} | |
uses: anchore/sbom-action@v0 | |
with: | |
image: ${{ steps.build-agent.outputs.imageid }} | |
artifact-name: sbom.spdx.json | |
upload-artifact: true | |
config: .github/edgebit/build-syft.yaml | |
- name: Save metadata to an artifact | |
if: ${{ matrix.arch == 'amd64' }} | |
run: | | |
cat > /tmp/metadata.json <<EOF | |
{ | |
"image-id": "${{ steps.build-agent.outputs.imageid }}", | |
"image-tag": "${{ steps.meta.outputs.tags }}", | |
"pr-number": "${{ github.event.number }}", | |
"tags": "${{ github.ref == 'refs/heads/main' && 'latest' || '' }}" | |
} | |
EOF | |
- uses: actions/upload-artifact@v3 | |
if: ${{ matrix.arch == 'amd64' }} | |
with: | |
name: metadata.json | |
path: /tmp/metadata.json | |
docker-combine: | |
needs: build-binaries | |
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} | |
permissions: | |
id-token: write # for AWS OIDC | |
runs-on: ubuntu-latest | |
steps: | |
- name: Authenticate to AWS | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-region: us-east-1 | |
role-to-assume: arn:aws:iam::970625735569:role/GitHubActionsECRPush | |
- name: Configure AWS Docker Auth | |
uses: aws-actions/amazon-ecr-login@v1 | |
with: | |
registry-type: public | |
mask-password: true | |
- name: Generate Image Metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
public.ecr.aws/edgebit/edgebit-agent | |
tags: | | |
type=ref,event=pr | |
- name: Combine into multi-arch | |
shell: bash | |
run: | | |
docker buildx imagetools create \ | |
--tag ${{ steps.meta.outputs.tags }} \ | |
${{ steps.meta.outputs.tags }}-amd64 \ | |
${{ steps.meta.outputs.tags }}-arm64 |