Helmfile: Install packages for Ubuntu 24.04, add Podman #148
Workflow file for this run
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
## This GitHub workflow is inspired by a workflow from the Oracle Docker Images repository, | |
## which is licensed under the Universal Permissive License (UPL) version 1.0. | |
## | |
## Copyright (c) 2019, 2023 Oracle and/or its affiliates. | |
## The Universal Permissive License (UPL), Version 1.0, https://oss.oracle.com/licenses/upl/ | |
## | |
## https://github.com/oracle/docker-images/blob/73fc5e48f3efffd311a8ca5cc74c4b094855e02e/.github/workflows/build-and-push-dev-images.yml | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
jobs: | |
prepare: | |
runs-on: ubuntu-22.04 | |
outputs: | |
skip_build: ${{ steps.changes.outputs.skip_build }} | |
matrix: ${{ steps.changes.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create matrix for changed images | |
id: changes | |
run: | | |
changes=$(mktemp) | |
latest_tag=$(git describe --tags --abbrev=0) | |
git diff --name-only --patch "${latest_tag}..HEAD" > "${changes}" | |
matrix=$( | |
for dockerfile in */Dockerfile; do | |
image=$(dirname "${dockerfile}") | |
version=$(grep -m1 'FROM ' "${dockerfile}" | awk -F ':' '{print $2}' | sed 's/[^0-9.]//g') | |
if [ -n "$version" ] && grep -q "${image}" "${changes}"; then | |
echo "${image};${version}" | |
fi | |
done | jq --slurp --raw-input --compact-output ' | |
split("\n") | | |
.[:-1] | | |
map(split(";")) | | |
map({"image": .[0], "version": .[1]})' | |
) | |
rm "${changes}" | |
if [[ ${matrix} == "[]" ]]; then | |
# Empty array -- change didn't impact any image | |
skip_build=true | |
else | |
skip_build=false | |
matrix=$(jq --compact-output '{ "include": .}' <<<"${matrix}") | |
fi | |
echo "skip_build=${skip_build}" >> "$GITHUB_OUTPUT" | |
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" | |
build: | |
needs: [ prepare ] | |
if: always() && needs.prepare.outputs.skip_build == 'false' | |
strategy: | |
matrix: ${{fromJson(needs.prepare.outputs.matrix)}} | |
fail-fast: false | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.image }} | |
load: true | |
tags: "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${{ matrix.version }}" | |
- name: Push image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
docker push "ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${{ matrix.version }}" | |
- name: Tag commit | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
git tag "${{ matrix.image }}-${{ matrix.version }}" | |
git push origin "${{ matrix.image }}-${{ matrix.version }}" | |
- name: Inspect image | |
run: | | |
docker image inspect ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}:${{ matrix.version }} | |
build_success: | |
needs: [ build ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Build success | |
run: echo "Build success" |