Add CI/CD pipeline and docker-compose for deployment
- Gitea Actions workflow: test → build → push to container registry - docker-compose.yml for host deployment (host network for PXE) - Update example config to use container paths (/data, /etc/provisioning) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: build-and-push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
- name: Run tests
|
||||
run: go test ./...
|
||||
- name: Vet
|
||||
run: go vet ./...
|
||||
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.thewrightserver.net
|
||||
username: josh
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: deploy/Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
gitea.thewrightserver.net/josh/provisioning:latest
|
||||
gitea.thewrightserver.net/josh/provisioning:${{ github.sha }}
|
||||
@@ -3,18 +3,18 @@ server:
|
||||
public_url: "http://192.168.1.100:8080"
|
||||
|
||||
database:
|
||||
path: "./data/provisioning.db"
|
||||
path: "/data/provisioning.db"
|
||||
|
||||
pxe:
|
||||
enabled: true
|
||||
interface: "eth0"
|
||||
subnet: "192.168.1.0/24"
|
||||
runtime_dir: "./data/pxe"
|
||||
tftp_root: "./data/tftp"
|
||||
runtime_dir: "/data/pxe"
|
||||
tftp_root: "/data/tftp"
|
||||
dnsmasq_bin: "/usr/sbin/dnsmasq"
|
||||
|
||||
images:
|
||||
dir: "./data/images"
|
||||
dir: "/data/images"
|
||||
|
||||
proxmox:
|
||||
existing_node: "192.168.1.10"
|
||||
@@ -37,4 +37,4 @@ infrastructure:
|
||||
locks:
|
||||
ttl_minutes: 60
|
||||
|
||||
server_types_path: "./server-types.yaml"
|
||||
server_types_path: "/etc/provisioning/server-types.yaml"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
provisioning:
|
||||
image: gitea.thewrightserver.net/josh/provisioning:latest
|
||||
container_name: provisioning
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
volumes:
|
||||
- ./provisioning.yaml:/etc/provisioning/provisioning.yaml:ro
|
||||
- ./server-types.yaml:/etc/provisioning/server-types.yaml:ro
|
||||
- ./keys:/etc/provisioning/keys:ro
|
||||
- data:/data
|
||||
command: ["-config", "/etc/provisioning/provisioning.yaml"]
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
|
||||
volumes:
|
||||
data:
|
||||
Reference in New Issue
Block a user