-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add image descriptions and source
More information in case the image is consumed via different sources than the official one. While at it, make the action steps more readable by adding separating newlines. Signed-off-by: Jan Kiszka <[email protected]>
- Loading branch information
1 parent
9103719
commit c4e4bf3
Showing
4 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,56 +5,87 @@ inputs: | |
required: true | ||
deploy-token: | ||
required: true | ||
cache-key: | ||
image-name: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
driver-opts: image=moby/buildkit:v0.13.0 | ||
|
||
- name: Login to ghcr.io | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.deploy-user }} | ||
password: ${{ inputs.deploy-token }} | ||
|
||
- name: Set SOURCE_DATE_EPOCH | ||
run: | | ||
echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Determine Debian tag | ||
run: | | ||
DEBIAN_RELEASE=$(grep -m 1 'ARG DEBIAN_TAG=' Dockerfile | sed 's/.*DEBIAN_TAG=\(.*\)-.*/\1/') | ||
echo "DEBIAN_TAG=$(podman image search --list-tags debian --limit 1000000000 | \ | ||
grep "$DEBIAN_RELEASE-.*-slim" | sort -r | head -1 | sed 's/.*[ ]\+//')" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Prepare repository for COPY-in | ||
run: | | ||
git clone . /home/runner/kas-clone | ||
shell: bash | ||
|
||
- name: Define image description | ||
run: | | ||
case ${{ inputs.image-name }} in | ||
kas) | ||
echo "IMAGE_DESCRIPTION=kas build environment for Yocto/OpenEmbedded projects" >> $GITHUB_ENV | ||
;; | ||
kas-isar) | ||
echo "IMAGE_DESCRIPTION=kas build environment for isar-based Debian projects" >> $GITHUB_ENV | ||
;; | ||
esac | ||
shell: bash | ||
|
||
- name: Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
annotations: | | ||
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }} | ||
org.opencontainers.image.licenses=MIT and others | ||
env: | ||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | ||
|
||
- name: Cache var-cache-apt | ||
id: cache-var-cache-apt | ||
uses: actions/cache@v4 | ||
with: | ||
path: var-cache-apt | ||
key: var-cache-apt-${{ env.DEBIAN_TAG }}-${{ inputs.cache-key }} | ||
key: var-cache-apt-${{ env.DEBIAN_TAG }}-${{ inputs.image-name }} | ||
|
||
- name: Cache var-lib-apt | ||
id: cache-var-lib-apt | ||
uses: actions/cache@v4 | ||
with: | ||
path: var-lib-apt | ||
key: var-lib-apt-${{ env.DEBIAN_TAG }}-${{ inputs.cache-key }} | ||
key: var-lib-apt-${{ env.DEBIAN_TAG }}-${{ inputs.image-name }} | ||
|
||
- name: Inject var-cache-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
cache-source: var-cache-apt | ||
cache-target: /var/cache/apt | ||
skip-extraction: ${{ steps.cache-var-cache-apt.outputs.cache-hit }} | ||
|
||
- name: Inject var-lib-apt into docker | ||
uses: reproducible-containers/[email protected] | ||
with: | ||
|
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 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 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