docker: build locally on NAS, no registry needed
This commit is contained in:
@@ -1,39 +1,11 @@
|
||||
name: Build & Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup
|
||||
shell: sh
|
||||
run: apk add --no-cache docker-cli bash git
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | \
|
||||
docker login localhost:3001 \
|
||||
-u "${{ secrets.REGISTRY_USER }}" \
|
||||
--password-stdin
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg NEXT_PUBLIC_API_URL="${{ vars.NEXT_PUBLIC_API_URL }}" \
|
||||
--build-arg NEXT_PUBLIC_APP_URL="${{ vars.NEXT_PUBLIC_APP_URL }}" \
|
||||
-t localhost:3001/mrdiderot/michess:latest \
|
||||
.
|
||||
|
||||
- name: Push to Registry
|
||||
run: docker push localhost:3001/mrdiderot/michess:latest
|
||||
|
||||
- name: Logout
|
||||
if: always()
|
||||
run: docker logout localhost:3001
|
||||
- name: Info
|
||||
run: echo "Manueller Build-Trigger. Image wird direkt auf der NAS gebaut."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
michess:
|
||||
image: localhost:3001/mrdiderot/michess:latest
|
||||
build: .
|
||||
container_name: michess
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# MiChess Update-Script
|
||||
# Auf der NAS ausführen um das neueste Image zu laden
|
||||
# Auf der NAS ausführen nach dem Synchronisieren der Dateien
|
||||
|
||||
set -e
|
||||
|
||||
@@ -9,8 +9,8 @@ cd "$SCRIPT_DIR"
|
||||
|
||||
echo "=== MiChess Update ==="
|
||||
echo ""
|
||||
echo "1. Neues Image aus Registry laden..."
|
||||
docker compose pull michess
|
||||
echo "1. Image neu bauen..."
|
||||
docker compose build michess
|
||||
|
||||
echo ""
|
||||
echo "2. Container neu starten..."
|
||||
|
||||
Reference in New Issue
Block a user