Skip to content

agent: add container build ci #1

agent: add container build ci

agent: add container build ci #1

name: Build and push container image
# Configures this workflow to run every time a tag is created
on:
push:
branches:
- main
- docker-ci
paths:
- agent/**
- .github/workflows/build_agent_container.yaml
# NOTE: we may want to switch to matrix build for multi-platform support if this is taking too long
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
build-and-push-image:

Check failure on line 24 in .github/workflows/build_agent_container.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build_agent_container.yaml

Invalid workflow file

You have an error in your yaml syntax on line 24
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
#
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Setup for multi-platform
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check outputs
run: cd agent && make docker-build-only
env:
AGENT_IMAGE: ${{env.IMAGE_NAME}}/agent
TAGS: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agent:${{ env.GITHUB_SHA }}
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{env.IMAGE_NAME}}/agent
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true