Try more simple example
Some checks failed
build-ublue-custom / Build and push image (push) Failing after 5m40s

This commit is contained in:
Florian RICHER 2024-10-11 22:54:03 +02:00
parent 4449a351cd
commit f9ef5bf07b

View file

@ -16,7 +16,6 @@ on:
env:
MY_IMAGE_NAME: "${{ gitea.event.repository.name }}" # the name of the image produced by this build, matches repo names
MY_IMAGE_DESC: "My Customized Universal Blue Image"
IMAGE_REGISTRY: "gitea.mrdev023.fr/florian.richer" # do not edit
jobs:
build_push:
@ -43,47 +42,6 @@ jobs:
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Generate tags
id: generate-tags
shell: bash
run: |
# Generate a timestamp for creating an image version history
TIMESTAMP="$(date +%Y%m%d)"
COMMIT_TAGS=()
BUILD_TAGS=()
# Have tags for tracking builds during pull request
SHA_SHORT="${GITEA_SHA::7}"
COMMIT_TAGS+=("pr-${{ gitea.event.number }}")
COMMIT_TAGS+=("${SHA_SHORT}")
# Append matching timestamp tags to keep a version history
for TAG in "${BUILD_TAGS[@]}"; do
BUILD_TAGS+=("${TAG}-${TIMESTAMP}")
done
BUILD_TAGS+=("${TIMESTAMP}")
BUILD_TAGS+=("latest")
if [[ "${{ gitea.event_name }}" == "pull_request" ]]; then
echo "Generated the following commit tags: "
for TAG in "${COMMIT_TAGS[@]}"; do
echo "${TAG}"
done
alias_tags=("${COMMIT_TAGS[@]}")
else
alias_tags=("${BUILD_TAGS[@]}")
fi
echo "Generated the following build tags: "
for TAG in "${BUILD_TAGS[@]}"; do
echo "${TAG}"
done
alias_tags_string=$(IFS=, ; echo "${alias_tags[*]}")
echo "alias_tags=${alias_tags_string}" >> $GITEA_OUTPUT
# Build metadata
- name: Image Metadata
uses: https://github.com/docker/metadata-action@v5
@ -111,8 +69,7 @@ jobs:
context: .
file: ./Containerfile
push: true
tags: ${{ steps.generate-tags.outputs.alias_tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: gitea.mrdev023.fr/florian.richer/${{ env.MY_IMAGE_NAME }}:latest
# This section is optional and only needs to be enabled if you plan on distributing
# your project for others to consume. You will need to create a public and private key