-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
There's a lot of yml dealing with building the docker images:
nuget-trends/.github/workflows/scheduler-workflow.yml
Lines 36 to 66 in b4fbc34
- name: Prepare Docker | |
id: docker-prep | |
run: | | |
DOCKER_IMAGE=nugettrends/nugettrends.scheduler | |
VERSION=noop | |
ENVIRONMENT=test | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
VERSION=${GITHUB_REF#refs/tags/} | |
ENVIRONMENT=prod | |
elif [[ $GITHUB_REF == refs/heads/main ]]; then | |
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') | |
fi | |
TAGS="${DOCKER_IMAGE}:${VERSION}" | |
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | |
MINOR=${VERSION%.*} | |
MAJOR=${MINOR%.*} | |
TAGS="$TAGS,${DOCKER_IMAGE}:${MINOR},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest" | |
elif [ "${{ github.event_name }}" = "push" ]; then | |
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}" | |
fi | |
echo ::set-output name=environment::${ENVIRONMENT} | |
echo ::set-output name=version::${VERSION} | |
echo ::set-output name=tags::${TAGS} | |
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | |
- name: Docker values debug | |
run: | | |
echo ${{ steps.docker-prep.outputs.environment }} | |
echo ${{ steps.docker-prep.outputs.version }} | |
echo ${{ steps.docker-prep.outputs.tags }} | |
echo ${{ steps.docker-prep.outputs.created }} |
.NET8 has this stuff built in
Metadata
Metadata
Assignees
Labels
No labels