Skip to content

Commit

Permalink
Update kuksa-client CI action to current standard
Browse files Browse the repository at this point in the history
Tagging images in ttl.sh with GIT hash to unambigously identify them.
Reducing lifetime to 1h to allow faster cleanup on ttl.sh

Not pushing PRs to GHCR

Signed-off-by: Sebastian Schildt <[email protected]>
  • Loading branch information
SebastianSchildt committed Nov 30, 2022
1 parent 57b39f4 commit d212ff5
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/kuksa-client.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: kuksa_client_docker

on:
Expand All @@ -21,9 +34,7 @@ jobs:
needs: checkrights

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/[email protected]
Expand All @@ -38,17 +49,27 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# only needed for runners without buildx setup, will be slow
#- name: Set up QEMU
# uses: docker/setup-qemu-action@v2

#- name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
if: needs.checkrights.outputs.have_secrets == 'true'
uses: docker/login-action@v2
with:
registry: ${{ needs.checkrights.outputs.registry }}
username: kuksa-bot
password: ${{ secrets.PUSH_CONTAINER_TOKEN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
#username: kuksa-bot #keep it for now, maybe the standard token can not push to same package
#password: ${{ secrets.PUSH_CONTAINER_TOKEN }}

- name: Build kuksa command line client docker and push to ghcr.io
if: needs.checkrights.outputs.have_secrets == 'true'
if: ${{ needs.checkrights.outputs.have_secrets == 'true' && github.event_name != 'pull_request' }}
uses: docker/build-push-action@v2
with:
platforms: |
Expand All @@ -57,11 +78,13 @@ jobs:
context: .
file: kuksa-client/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: |
${{ steps.meta.outputs.tags }}
ttl.sh/kuksa.val/kuksa-client-${{github.sha}}:1h
labels: ${{ steps.meta.outputs.labels }}

- name: Build ephemereal kuksa command line client docker and push to ttl.sh
if: needs.checkrights.outputs.have_secrets == 'false'
if: ${{ needs.checkrights.outputs.have_secrets == 'false' || github.event_name == 'pull_request' }}
uses: docker/build-push-action@v2
with:
platforms: |
Expand All @@ -70,5 +93,5 @@ jobs:
context: .
file: kuksa-client/Dockerfile
push: true
tags: "ttl.sh/kuksa.val/kuksa-client:8h"
tags: "ttl.sh/kuksa.val/kuksa-client-${{github.sha}}:1h"
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit d212ff5

Please sign in to comment.