constellation/.github/workflows/build-gcp-guest-agent.yml
Malte Poll 0f57f03846
Allow concurrent actions on the same branch. (#281)
Actions are free for public repos and we want to see every CI failure
2022-10-14 17:47:46 +02:00

61 lines
1.9 KiB
YAML

name: Build and Upload GCP guest-agent container
env:
REGISTRY: ghcr.io
on: [workflow_dispatch]
jobs:
build-gcp-guest-agent:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
version: ["20220927.00"]
include:
- version: "20220927.00"
latest: true
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
with:
repository: "GoogleCloudPlatform/guest-agent"
ref: refs/tags/${{ matrix.version }}
path: "guest-agent"
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0
with:
path: "constellation"
- name: Docker meta
id: meta
uses: docker/metadata-action@12cce9efe0d49980455aaaca9b071c0befcdd702 # tag=v4.1.0
with:
images: |
${{ env.REGISTRY }}/edgelesssys/gcp-guest-agent
flavor: |
latest=${{ matrix.latest || false }}
tags: |
type=raw,value=${{ matrix.version }}
- 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@c56af957549030174b10d6867f20e78cfd7debc5 # tag=v3.2.0
with:
context: ./guest-agent
file: ./constellation/3rdparty/gcp-guest-agent/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}