First commit for converting angular js #11
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
#!/bin/bash | ||
set -e # Exit on error | ||
echo "Building Docker image..." | ||
docker build --progress=plain -t amharic_dbpedia_chapter . | ||
echo "Running Docker container..." | ||
container_id=$(docker run -d amharic_dbpedia_chapter) | ||
trap 'echo "Cleaning up..."; docker rm -f $container_id > /dev/null 2>&1' EXIT | ||
echo "Extracting built files from container..." | ||
mkdir -p ./docs/Amharic_DBpedia_Chapter | ||
docker cp $container_id:/app/Amharic_DBpedia_Chapter ./docs/Amharic_DBpedia_Chapter | ||
echo "Stopping and removing container..." | ||
docker rm -f $container_id > /dev/null 2>&1 | ||
echo "Pushing built files to the main branch..." | ||
# Add files to git and commit if there are changes | ||
git add ./docs/Amharic_DBpedia_Chapter | ||
if ! git diff --cached --exit-code > /dev/null; then | ||
git commit -m "Deploy Amharic_DBpedia_Chapter to GitHub Pages" | ||
git push origin main | ||
echo "Deployment to main branch complete!" | ||
else | ||
echo "No changes to commit." | ||
fi |