ci: frequently build up to date gcp guest-agent (#1315)

Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
Paul Meyer 2023-03-01 07:52:52 -05:00 committed by GitHub
parent fc33a74c78
commit f9bb7c5f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,12 @@
name: Build and Upload GCP guest-agent container name: Build and Upload GCP guest-agent container
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * 2" # Every Tuesday at 4am UTC
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
on: [workflow_dispatch]
jobs: jobs:
build-gcp-guest-agent: build-gcp-guest-agent:
@ -9,18 +14,20 @@ jobs:
permissions: permissions:
contents: read contents: read
packages: write packages: write
strategy:
matrix:
version: ["20220927.00"]
include:
- version: "20220927.00"
latest: true
steps: steps:
- name: Get latest release of guest-agent
id: latest-release
run: |
latest=$(curl -fsSL https://api.github.com/repos/GoogleCloudPlatform/guest-agent/releases/latest | jq -r .tag_name)
echo "Latest version of guest-agent is $latest"
echo "latest=$latest" >> "$GITHUB_OUTPUT"
- name: Checkout GoogleCloudPlatform/guest-agent - name: Checkout GoogleCloudPlatform/guest-agent
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with: with:
repository: "GoogleCloudPlatform/guest-agent" repository: "GoogleCloudPlatform/guest-agent"
ref: refs/tags/${{ matrix.version }} ref: refs/tags/${{ steps.latest-release.outputs.latest }}
path: "guest-agent" path: "guest-agent"
- name: Checkout Constellation - name: Checkout Constellation
@ -36,9 +43,12 @@ jobs:
images: | images: |
${{ env.REGISTRY }}/edgelesssys/gcp-guest-agent ${{ env.REGISTRY }}/edgelesssys/gcp-guest-agent
flavor: | flavor: |
latest=${{ matrix.latest || false }} latest=false
tags: | tags: |
type=raw,value=${{ matrix.version }} type=raw,value=${{ steps.latest-release.outputs.latest }}
type=raw,value=${{ github.ref_name }},enable=${{ github.ref_name != 'main' }}
type=sha,value=${{ github.sha }}
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
- name: Log in to the Container registry - name: Log in to the Container registry
id: docker-login id: docker-login