ci: use git SHA tag instead of latest for deterministic Nomad deploys
All checks were successful
Build and Deploy / deploy (push) Successful in 36s
All checks were successful
Build and Deploy / deploy (push) Successful in 36s
This commit is contained in:
@@ -39,14 +39,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${IMAGE}:latest .
|
SHA=$(echo "$GITHUB_SHA" | cut -c1-8)
|
||||||
|
docker build -t ${IMAGE}:${SHA} -t ${IMAGE}:latest .
|
||||||
|
docker push ${IMAGE}:${SHA}
|
||||||
docker push ${IMAGE}:latest
|
docker push ${IMAGE}:latest
|
||||||
|
echo "IMAGE_TAG=${SHA}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Validate Nomad job
|
- name: Validate Nomad job
|
||||||
run: nomad job validate ${SERVICE_NAME}.nomad
|
run: sed "s|:latest|:${IMAGE_TAG}|g" ${SERVICE_NAME}.nomad | nomad job validate -
|
||||||
|
|
||||||
- name: Deploy to Nomad
|
- name: Deploy to Nomad
|
||||||
run: nomad job run ${SERVICE_NAME}.nomad
|
run: sed "s|:latest|:${IMAGE_TAG}|g" ${SERVICE_NAME}.nomad | nomad job run -
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user