version changes
All checks were successful
Build, Test & Publish / Build (push) Successful in 30s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 41s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 35s

This commit is contained in:
2026-02-04 13:12:11 +11:00
parent 256c55e585
commit 1a3b0eb43e
2 changed files with 11 additions and 21 deletions

View File

@@ -47,15 +47,6 @@ jobs:
tags: |
type=raw,value=latest
# - name: Setup Docker Metadata
# id: meta
# uses: docker/metadata-action@v4
# with:
# images: liamsgit.dev/LiamPietralla/code-snippets
# tags: |
# type=raw,value=latest
# type=sha,value=${{ github.sha }}
- name: Login to Registry
uses: docker/login-action@v3
with:
@@ -86,16 +77,10 @@ jobs:
with:
nomad_version: '1.10.5'
# - name: Deploy Job to Nomad
# run: |
# nomad job run -var="version=${{ github.sha }}" infra/nomad/code-snippets.nomad.hcl
# env:
# NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
# NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
- name: Deploy Job to Nomad
run: |
nomad job run infra/nomad/code-snippets.nomad.hcl
export DEPLOYMENT_VERSION="${GITHUB_SHA:0:7}-$(date +%s)"
nomad job run -var="deployment_version=$DEPLOYMENT_VERSION" infra/nomad/code-snippets.nomad.hcl
env:
NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}

View File

@@ -1,12 +1,17 @@
variable "version" {
variable "deployment_version" {
type = string
default = "latest"
description = "The deployment version from CI/CD"
default = "unknown"
}
job "code-snippets" {
datacenters = ["dc1"]
type = "service"
meta {
version = var.deployment_version
}
constraint {
operator = "="
attribute = "${meta.machine_role}"
@@ -26,7 +31,7 @@ job "code-snippets" {
driver = "docker"
config {
image = "liamsgit.dev/liampietralla/code-snippets:${var.version}"
image = "liamsgit.dev/liampietralla/code-snippets:latest"
force_pull = true
ports = ["http"]
}