Skip to content

fix(ci): update outdated GitHub actions #48

fix(ci): update outdated GitHub actions

fix(ci): update outdated GitHub actions #48

Workflow file for this run

#
# We only publish docker files on a push AND if the tpm2-software is the org.
# This way forks don't try to build AND publish
#
name: Publish
on:
push
permissions:
contents: read
packages: write
jobs:
publish-image:
name: Publish Docker Images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [
"fedora-32", "fedora-34",
"opensuse-leap-15.2", "opensuse-leap", "opensuse-leap-ossl3",
"fedora-32.ppc64le",
"alpine-3.15",
"ubuntu-22.04", "ubuntu-22.04-mbedtls-3.1", "ubuntu-24.04"
]
if: "github.repository_owner == 'tpm2-software'"
steps:
-
name: Check out the repo
uses: actions/checkout@v4
-
name: Check Diff for Changes
# TODO replace get-diff-action, as it is no longer maintained since 2023-11-24
uses: technote-space/get-diff-action@v6
with:
FILES: |
${{ matrix.distro }}.docker.m4
PATTERNS: |
modules/*
-
name: Build the Dockerfiles
run: make -j $(nproc)
if: env.GIT_DIFF
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: env.GIT_DIFF
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: env.GIT_DIFF
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: env.GIT_DIFF
-
name: Push to GitHub Packages
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./${{ matrix.distro }}.docker
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.distro }}:latest
if: env.GIT_DIFF