constellation/.github/workflows/build-gcp-guest-agent.yml

64 lines
2.1 KiB
YAML
Raw Normal View History

name: Build and Upload GCP guest-agent container
env:
REGISTRY: ghcr.io
on: [workflow_dispatch]
jobs:
build-gcp-guest-agent:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
strategy:
matrix:
2022-10-07 11:45:00 -04:00
version: ["20220927.00"]
include:
2022-10-07 11:45:00 -04:00
- version: "20220927.00"
latest: true
steps:
- name: Checkout GoogleCloudPlatform/guest-agent
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
repository: "GoogleCloudPlatform/guest-agent"
ref: refs/tags/${{ matrix.version }}
path: "guest-agent"
- name: Checkout Constellation
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
path: "constellation"
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Docker meta
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96 # v4.3.0
with:
images: |
${{ env.REGISTRY }}/edgelesssys/gcp-guest-agent
flavor: |
latest=${{ matrix.latest || false }}
tags: |
type=raw,value=${{ matrix.version }}
2022-09-14 09:14:26 -04:00
- name: Log in to the Container registry
id: docker-login
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare hardcoded configuration file
run: |
cp "${GITHUB_WORKSPACE}/constellation/3rdparty/gcp-guest-agent/instance_configs.cfg" "${GITHUB_WORKSPACE}/guest-agent/"
- name: Build and push container image
id: build
uses: docker/build-push-action@37abcedcc1da61a57767b7588cb9d03eb57e28b3 # v3.3.0
with:
context: ./guest-agent
file: ./constellation/3rdparty/gcp-guest-agent/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}