This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
forked from enricoros/big-AGI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use GitHub Actions to build and deploy image
- Loading branch information
Showing
3 changed files
with
28 additions
and
42 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +0,0 @@ | ||
resource "null_resource" "docker_build" { | ||
triggers = { | ||
always_run = "${timestamp()}" | ||
} | ||
|
||
provisioner "local-exec" { | ||
command = <<EOT | ||
cd "${path.module}/.." | ||
az acr login --name ${azurerm_container_registry.acr.name} || exit 1 | ||
if ! docker version > /dev/null 2>&1; then | ||
echo "Docker is not running. Please start Docker and try again." | ||
exit 1 | ||
fi | ||
# Create a temporary Buildx builder with docker-container driver | ||
BUILDER_NAME=temp-builder-$(date +%s) | ||
docker buildx create --name $BUILDER_NAME --use --driver docker-container | ||
# Remove existing images | ||
docker image remove ${azurerm_container_registry.acr.login_server}/${var.project_name}:latest || true | ||
az acr repository delete --name ${azurerm_container_registry.acr.name} --image ${var.project_name}:latest --yes || true | ||
# Build and push big-agi image | ||
docker buildx build --platform linux/amd64,linux/arm64 -t ${azurerm_container_registry.acr.login_server}/${var.project_name}:latest --push . | ||
# Clean up the temporary builder | ||
docker buildx rm $BUILDER_NAME | ||
EOT | ||
} | ||
|
||
depends_on = [azurerm_container_registry.acr] | ||
} | ||
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