diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c3205e2a..388da9b6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,7 +1,7 @@ name: deploy on: push: - branches: [ master ] + branches: [ main ] env: GKE_CLUSTER: sltech-briq-k8s-cluster GKE_ZONE: europe-west3-c @@ -54,6 +54,4 @@ jobs: - name: Deploy run: |- - echo "$(git status)" - echo "$(git status --porcelain)" infra/deploy.sh diff --git a/infra/deploy.yaml b/infra/deploy.yaml index 2f0e2241..2507482f 100644 --- a/infra/deploy.yaml +++ b/infra/deploy.yaml @@ -1,5 +1,4 @@ #@ load("@ytt:data", "data") -#@ load("@ytt:template", "template") --- apiVersion: apps/v1 kind: Deployment diff --git a/infra/render.sh b/infra/render.sh index 295f52b4..9d6ea84b 100755 --- a/infra/render.sh +++ b/infra/render.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e +TAG=${TAG:=$(git rev-parse HEAD)} + mkdir -p infra/dist ytt -f infra/schema.yaml -f infra/ --data-value "image_tag=$TAG" > infra/dist/manifests.yaml echo "validating client-side" diff --git a/infra/run-docker.sh b/infra/run-docker.sh index 67997fc2..2a5a9a94 100755 --- a/infra/run-docker.sh +++ b/infra/run-docker.sh @@ -3,13 +3,14 @@ set -e npx vite build --outDir infra/dist/www/ +NAME="briq-builder" TAG=${TAG:=$(git rev-parse HEAD)} echo "Building docker image, tagging $TAG" -IMAGE_NAME="europe-west3-docker.pkg.dev/healthy-saga-329513/sltech-briq/briq-builder:$TAG" +IMAGE_NAME="europe-west3-docker.pkg.dev/healthy-saga-329513/sltech-briq/$NAME:$TAG" docker build infra/ -t "$IMAGE_NAME" docker push "$IMAGE_NAME" # Tag the image as 'latest' locally -docker tag "$IMAGE_NAME" briq-builder:latest +docker tag "$IMAGE_NAME" "$NAME:latest" # Cleanup docker image rm "$IMAGE_NAME" \ No newline at end of file