Compare commits

...

11 Commits

Author SHA1 Message Date
e2940941a8 Fixed typo
All checks were successful
Build a new image for the MycroForge docs / build (push) Has been skipped
2024-10-13 18:45:23 +02:00
12a16be6ed Added trimming for the VERSION variable 2024-10-13 18:43:15 +02:00
768136696f Added echos to build job
All checks were successful
Build a new image for the MycroForge docs / build (push) Successful in 1m11s
2024-10-13 18:40:59 +02:00
3de2322524 Renamed test job to build
All checks were successful
Build a new image for the MycroForge docs / build (push) Successful in 1m10s
2024-10-13 18:37:18 +02:00
b777d5c899 Changed run name in build.yml
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 1m18s
2024-10-13 18:33:42 +02:00
cbf465f444 Piped password into docker login command
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 1m50s
2024-10-13 14:36:32 +02:00
abbb0fde41 Fixed secret references
Some checks failed
Build a new image for the MycroForge docs / test (push) Failing after 4s
2024-10-13 14:35:25 +02:00
994b4c3761 Removed dotnet config section and uncommented code
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 4s
2024-10-13 14:31:55 +02:00
b85e424dbe Removed test and commented build
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 5s
2024-10-13 14:30:28 +02:00
4edae0830f Removed dotnet action
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 5s
2024-10-13 14:28:03 +02:00
fd04ffbc19 Added build pipeline
All checks were successful
Build a new image for the MycroForge docs / test (push) Successful in 26s
2024-10-13 14:25:25 +02:00
3 changed files with 42 additions and 1 deletions

View File

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

View File

@@ -43,5 +43,6 @@
},
"engines": {
"node": ">=18.0"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}

1
version.txt Normal file
View File

@@ -0,0 +1 @@
0.0.1