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 }}
|
||||
Reference in New Issue
Block a user