-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: More (standardized) docker image meta-data
- Loading branch information
Showing
2 changed files
with
26 additions
and
13 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 |
---|---|---|
|
@@ -32,28 +32,42 @@ jobs: | |
with: | ||
username: ${{ vars.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Prepare build meta-data | ||
run: | | ||
# This allows reproducible docker builds | ||
echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV | ||
echo "GIT_VERSION=$(git describe --broken --always --tags --dirty)" >> $GITHUB_ENV | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
annotations: | | ||
org.opencontainers.image.version=${{ env.GIT_VERSION }} | ||
org.opencontainers.image.documentation="https://github.com/movedo/MoVeDo/blob/${{ env.GIT_VERSION }}/README.md" | ||
org.opencontainers.image.vendor="Open Source Ecology Germany e.V." | ||
# org.opencontainers.image.authors="Robin Vobruba <[email protected]>" | ||
# description="This can be used as a CI base image when generating documents using MoVeDo - https://github.com/movedo/MoVeDo/" | ||
# maintainer="Robin Vobruba <[email protected]>" | ||
# version="1.x" | ||
- | ||
name: Push to Docker Hub | ||
uses: docker/build-push-action@v6 | ||
env: | ||
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
annotations: ${{ steps.meta.outputs.annotations }} | ||
build-args: | | ||
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true | ||
#- name: Push to GitHub Packages | ||
# uses: docker/build-push-action@v2 | ||
# with: | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
# registry: docker.pkg.github.com | ||
# #repository: my-org/my-repo/my-image | ||
# repository: movedo/movedo/movedo | ||
# tag_with_ref: true |
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 |
---|---|---|
|
@@ -122,7 +122,6 @@ RUN git config --system --add safe.directory "${CONTENT_DIR}" | |
# ``` | ||
ENTRYPOINT ["/bin/bash", "-c", "ln -snf /bin/bash /bin/sh && /bin/bash -c $0" ] | ||
|
||
LABEL maintainer="Robin Vobruba <[email protected]>" | ||
LABEL version="1.x" | ||
LABEL description="This can be used as a CI base image when generating documents using MoVeDo - \ | ||
https://github.com/movedo/MoVeDo/" | ||
# NOTE Labels and annotaitons are added by CI (outside this Dockerfile); | ||
# see `.github/workflows/docker.yml`. | ||
# This also means they will not be availabel in local builds. |