44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
REGISTRY: 192.168.1.240:5000
|
|
IMAGE_NAME: seaguesser
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
version: v0.11.2
|
|
driver-opts: |
|
|
network=host
|
|
buildkitd-config-inline: |
|
|
[registry."192.168.1.240:5000"]
|
|
http = true
|
|
insecure = true
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
|
|
|
- name: Trigger Watchtower update
|
|
run: |
|
|
curl -X POST "http://192.168.1.240:8080/v1/update" \
|
|
-H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
|
|
|| echo "Watchtower trigger failed (maybe not configured)"
|