fix: replace buildx with plain docker build+push
Some checks failed
Build and Deploy MoneyMaker / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy MoneyMaker / build-and-deploy (push) Has been cancelled
buildx is only needed for multi-platform builds. For a single-platform debian-host runner, plain docker build + push is simpler and has no permission issues. Removed: - docker/setup-buildx-action (EACCES /tmp/buildx/certs) - docker/build-push-action - buildx context setup steps - BUILDX_CONFIG env var
This commit is contained in:
@@ -13,7 +13,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PATH: /usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/snap/bin
|
PATH: /usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/sbin:/bin:/snap/bin
|
||||||
DOCKER_HOST: unix:///var/run/docker.sock
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
BUILDX_CONFIG: /tmp/buildx
|
IMAGE: registry.i80.dk/gitea/mmd
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -23,44 +23,26 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uname -a
|
uname -a
|
||||||
whoami
|
whoami
|
||||||
|
docker --version
|
||||||
- name: Set up Docker Context for Buildx
|
|
||||||
id: buildx-context
|
|
||||||
run: |
|
|
||||||
docker context rm builders 2>/dev/null || true
|
|
||||||
docker context create builders --docker host=unix:///var/run/docker.sock
|
|
||||||
|
|
||||||
- name: Verify Docker
|
|
||||||
run: docker --version
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver: docker
|
|
||||||
env:
|
|
||||||
PATH: /usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin
|
|
||||||
|
|
||||||
- name: Log in to Harbor Registry
|
- name: Log in to Harbor Registry
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.HARBOR_ROBOT_TOKEN }}" | docker login registry.i80.dk -u "robot\$gitserver" --password-stdin
|
echo "${{ secrets.HARBOR_ROBOT_TOKEN }}" | docker login registry.i80.dk -u "robot\$gitserver" --password-stdin
|
||||||
env:
|
|
||||||
PATH: /usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v5
|
run: |
|
||||||
env:
|
docker build \
|
||||||
PATH: /usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin
|
--build-arg BUILD_VERSION="${{ github.ref_name }}-${{ github.sha }}" \
|
||||||
with:
|
--build-arg GIT_COMMIT="${{ github.sha }}" \
|
||||||
context: .
|
--build-arg BUILD_TIME="${{ github.event.head_commit.timestamp }}" \
|
||||||
file: ./Dockerfile
|
-t $IMAGE:latest \
|
||||||
push: true
|
-t $IMAGE:${{ github.sha }} \
|
||||||
tags: |
|
.
|
||||||
registry.i80.dk/gitea/mmd:latest
|
|
||||||
registry.i80.dk/gitea/mmd:${{ github.sha }}
|
- name: Push Docker image
|
||||||
build-args: |
|
run: |
|
||||||
BUILD_VERSION=${{ github.ref_name }}-${{ github.sha }}
|
docker push $IMAGE:latest
|
||||||
GIT_COMMIT=${{ github.sha }}
|
docker push $IMAGE:${{ github.sha }}
|
||||||
BUILD_TIME=${{ github.event.head_commit.timestamp }}
|
|
||||||
|
|
||||||
- name: Substitute secrets into Nomad job
|
- name: Substitute secrets into Nomad job
|
||||||
run: |
|
run: |
|
||||||
@@ -70,44 +52,30 @@ jobs:
|
|||||||
-e "s|__SAXO_APP_KEY__|${{ secrets.SAXO_APP_KEY }}|g" \
|
-e "s|__SAXO_APP_KEY__|${{ secrets.SAXO_APP_KEY }}|g" \
|
||||||
-e "s|__SAXO_APP_SECRET_1__|${{ secrets.SAXO_APP_SECRET_1 }}|g" \
|
-e "s|__SAXO_APP_SECRET_1__|${{ secrets.SAXO_APP_SECRET_1 }}|g" \
|
||||||
mmd.nomad > mmd_deploy.nomad
|
mmd.nomad > mmd_deploy.nomad
|
||||||
env:
|
|
||||||
PATH: /usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin
|
|
||||||
|
|
||||||
- name: Validate Nomad job
|
- name: Validate Nomad job
|
||||||
run: |
|
run: nomad job validate mmd_deploy.nomad
|
||||||
echo "Validating Nomad job specification..."
|
|
||||||
nomad job validate mmd_deploy.nomad
|
|
||||||
env:
|
env:
|
||||||
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
|
|
||||||
- name: Deploy to Nomad
|
- name: Deploy to Nomad
|
||||||
run: |
|
run: nomad job run mmd_deploy.nomad
|
||||||
echo "Deploying to Nomad cluster..."
|
|
||||||
nomad job run mmd_deploy.nomad
|
|
||||||
env:
|
env:
|
||||||
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
|
|
||||||
- name: Wait for deployment
|
- name: Wait for deployment
|
||||||
run: |
|
run: |
|
||||||
echo "Checking deployment status..."
|
|
||||||
sleep 15
|
sleep 15
|
||||||
nomad job status moneymaker
|
nomad job status moneymaker
|
||||||
echo "=== Allocations ==="
|
|
||||||
nomad job allocs moneymaker
|
nomad job allocs moneymaker
|
||||||
env:
|
env:
|
||||||
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
NOMAD_ADDR: "https://nomad.i80.dk:4646"
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting for Traefik routing..."
|
|
||||||
sleep 30
|
sleep 30
|
||||||
curl -f https://mmd.i80.dk/health || echo "Not yet available via Traefik — check Nomad UI"
|
curl -f https://mmd.i80.dk/health || echo "Not yet via Traefik — check Nomad UI"
|
||||||
env:
|
|
||||||
PATH: /usr/bin:/usr/local/bin:/bin:/sbin:/usr/sbin
|
|
||||||
|
|
||||||
- name: Deployment summary
|
- name: Deployment summary
|
||||||
run: |
|
run: |
|
||||||
echo "Deployment complete!"
|
echo "Done! Dashboard: https://mmd.i80.dk Health: https://mmd.i80.dk/health"
|
||||||
echo " Dashboard : https://mmd.i80.dk"
|
|
||||||
echo " Health : https://mmd.i80.dk/health"
|
|
||||||
echo " Nomad UI : https://nomad.i80.dk:4646"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user