Fix workflow: use debian-host runner and registry.i80.dk
Some checks failed
Build and Deploy citti / build-and-deploy (push) Failing after 5s
Some checks failed
Build and Deploy citti / build-and-deploy (push) Failing after 5s
Match BlaaAi deployment pattern: debian-host runner, Harbor registry, nomad CLI directly, NOMAD_ADDR=https://nomad.i80.dk:4646. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,37 +1,54 @@
|
|||||||
name: deploy
|
name: Build and Deploy citti
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
SERVICE_NAME: citti
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: debian-host
|
||||||
|
|
||||||
|
env:
|
||||||
|
PATH: /usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/snap/bin
|
||||||
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Log in to Docker Registry
|
||||||
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login gea.i80.dk -u hjess --password-stdin
|
|
||||||
|
|
||||||
- name: Build & push
|
|
||||||
run: |
|
run: |
|
||||||
|
echo "${{ secrets.HARBOR_ROBOT_TOKEN }}" | docker login registry.i80.dk -u "robot\$gitserver" --password-stdin
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
SHA=$(git rev-parse --short HEAD)
|
||||||
docker build \
|
docker build \
|
||||||
-t gea.i80.dk/hjess/citti:latest \
|
-t registry.i80.dk/gitea/${SERVICE_NAME}:latest \
|
||||||
-t gea.i80.dk/hjess/citti:${{ gitea.sha }} .
|
-t registry.i80.dk/gitea/${SERVICE_NAME}:$SHA .
|
||||||
docker push gea.i80.dk/hjess/citti:latest
|
|
||||||
docker push gea.i80.dk/hjess/citti:${{ gitea.sha }}
|
- name: Push Docker image
|
||||||
|
run: |
|
||||||
|
SHA=$(git rev-parse --short HEAD)
|
||||||
|
docker push registry.i80.dk/gitea/${SERVICE_NAME}:latest
|
||||||
|
docker push registry.i80.dk/gitea/${SERVICE_NAME}:$SHA
|
||||||
|
|
||||||
- name: Deploy to Nomad
|
- name: Deploy to Nomad
|
||||||
env:
|
|
||||||
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }}
|
|
||||||
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
job_hcl=$(jq -Rs . < citti.nomad)
|
nomad job validate ${SERVICE_NAME}.nomad
|
||||||
job_json=$(curl -sf "${NOMAD_ADDR}/v1/jobs/parse" \
|
nomad job run ${SERVICE_NAME}.nomad
|
||||||
-H "Content-Type: application/json" \
|
env:
|
||||||
-d "{\"JobHCL\": ${job_hcl}}")
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
curl -sf -X POST "${NOMAD_ADDR}/v1/jobs" \
|
|
||||||
-H "X-Nomad-Token: ${NOMAD_TOKEN}" \
|
- name: Verify deployment
|
||||||
-H "Content-Type: application/json" \
|
run: |
|
||||||
-d "{\"Job\": ${job_json}}"
|
echo "Deployment triggered — checking status..."
|
||||||
echo "Deployed ${{ gitea.sha }}"
|
sleep 20
|
||||||
|
nomad job status ${SERVICE_NAME}
|
||||||
|
env:
|
||||||
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
|||||||
IMAGE ?= gea.i80.dk/hjess/citti
|
IMAGE ?= registry.i80.dk/gitea/citti
|
||||||
TAG ?= latest
|
TAG ?= latest
|
||||||
|
|
||||||
.PHONY: run install build push
|
.PHONY: run install build push
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ job "citti" {
|
|||||||
driver = "docker"
|
driver = "docker"
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "gea.i80.dk/hjess/citti:latest"
|
image = "registry.i80.dk/gitea/citti:latest"
|
||||||
ports = ["http"]
|
ports = ["http"]
|
||||||
force_pull = true
|
force_pull = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user