docker: build locally on NAS, no registry needed
This commit is contained in:
@@ -1,39 +1,11 @@
|
|||||||
name: Build & Push Docker Image
|
name: Build & Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
- name: Info
|
||||||
shell: sh
|
run: echo "Manueller Build-Trigger. Image wird direkt auf der NAS gebaut."
|
||||||
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
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
michess:
|
michess:
|
||||||
image: localhost:3001/mrdiderot/michess:latest
|
build: .
|
||||||
container_name: michess
|
container_name: michess
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# MiChess Update-Script
|
# 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
|
set -e
|
||||||
|
|
||||||
@@ -9,8 +9,8 @@ cd "$SCRIPT_DIR"
|
|||||||
|
|
||||||
echo "=== MiChess Update ==="
|
echo "=== MiChess Update ==="
|
||||||
echo ""
|
echo ""
|
||||||
echo "1. Neues Image aus Registry laden..."
|
echo "1. Image neu bauen..."
|
||||||
docker compose pull michess
|
docker compose build michess
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "2. Container neu starten..."
|
echo "2. Container neu starten..."
|
||||||
|
|||||||
Reference in New Issue
Block a user