47 lines
973 B
YAML
47 lines
973 B
YAML
name: Docker Build (local only)
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: host
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Docker preflight
|
|
run: |
|
|
command -v docker
|
|
docker --version
|
|
docker info
|
|
|
|
# Build and LOAD the image into the host's Docker (no registry)
|
|
- name: Build & load locally
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: false
|
|
load: true
|
|
tags: |
|
|
nfoguard:latest
|
|
|
|
deploy:
|
|
needs: build
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: host
|
|
|
|
steps:
|
|
- name: (Example) restart local container
|
|
run: |
|
|
docker rm -f nfoguard || true
|
|
docker run -d --name nfoguard \
|
|
--restart unless-stopped \
|
|
-p 8080:8080 \
|
|
nfoguard:latest
|