feat: add selecting a license for a deployment #905
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: Build Agents | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
build-agent: | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
agent: | |
- docker-agent | |
- kubernetes-agent | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Generate commit hash | |
id: generate | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Login to GitHub Container Registry | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0 | |
- name: Generate Docker Metadata | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ghcr.io/glasskube/distr/${{ matrix.agent }} | |
tags: | | |
type=ref,event=branch | |
type=sha,event=branch | |
type=semver,pattern={{version}} | |
labels: | | |
org.opencontainers.image.description=Distr agent software | |
org.opencontainers.image.vendor=Glasskube | |
- name: Docker build (push only for tag) | |
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0 | |
with: | |
platforms: ${{ startsWith(github.ref, 'refs/tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | |
file: Dockerfile.${{ matrix.agent }} | |
build-args: | | |
COMMIT=${{ steps.generate.outputs.sha_short }} | |
VERSION=${{ github.ref_name }} | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |