Removed dotnet config section and uncommented code
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 4s

This commit is contained in:
mdnapo 2024-10-13 14:31:40 +02:00
parent b85e424dbe
commit 994b4c3761

View File

@ -8,29 +8,27 @@ jobs:
if: gitea.ref == 'refs/heads/main' if: gitea.ref == 'refs/heads/main'
steps: steps:
- uses: https://github.com/actions/checkout@v4 - uses: https://github.com/actions/checkout@v4
with:
dotnet-version: '8.x'
- name: "Build and push Docker image" - name: "Build and push Docker image"
run: | run: |
IMAGE_NAME="git.devdisciples.com/devdisciples/m4gdocs" IMAGE_NAME="git.devdisciples.com/devdisciples/m4gdocs"
IMAGE_VERSION="$(cat version.txt)" IMAGE_VERSION="$(cat version.txt)"
VERSIONED_IMAGE_TAG="$IMAGE_NAME:$IMAGE_VERSION" VERSIONED_IMAGE_TAG="$IMAGE_NAME:$IMAGE_VERSION"
LATEST_IMAGE_TAG="$IMAGE_NAME:latest" LATEST_IMAGE_TAG="$IMAGE_NAME:latest"
echo "Hello?"
# # Login to the registry
# docker login git.devdisciples.com --username ${{ DOCKER_USER }} --password-stdin ${{ DOCKER_PASS }}
# # Check if the image exists. # Login to the registry
# # EXISTS = 0 if the image was found else 1. docker login git.devdisciples.com --username ${{ DOCKER_USER }} --password-stdin ${{ DOCKER_PASS }}
# EXISTS=$(docker manifest inspect $VERSIONED_TAG > /dev/null 2>&1; echo $?)
# # Build a new image and push it if the versioned tag was not found. # Check if the image exists.
# if [[ $EXISTS -eq 1 ]]; then # EXISTS = 0 if the image was found else 1.
# docker build -t $VERSIONED_IMAGE_TAG -t $LATEST_IMAGE_TAG . EXISTS=$(docker manifest inspect $VERSIONED_TAG > /dev/null 2>&1; echo $?)
# docker push $VERSIONED_IMAGE_TAG
# docker push $LATEST_IMAGE_TAG # Build a new image and push it if the versioned tag was not found.
# # Else notify the user that the image tag already exists and exit with status code 1. if [[ $EXISTS -eq 1 ]]; then
# else docker build -t $VERSIONED_IMAGE_TAG -t $LATEST_IMAGE_TAG .
# echo "Image $VERSIONED_TAG already exists, you should probably increment the version." docker push $VERSIONED_IMAGE_TAG
# exit 1 docker push $LATEST_IMAGE_TAG
# fi # Else notify the user that the image tag already exists and exit with status code 1.
else
echo "Image $VERSIONED_TAG already exists, you should probably increment the version."
exit 1
fi