ci: point images at git.menzel.center and add build-and-push workflow
CI / build-and-push (push) Successful in 4m5s
CI / build-and-push (push) Successful in 4m5s
Image references still pointed at the old server (10.10.6.10:3020/menzelj); menzelj was never a valid namespace there either, the actual account is menzeljonas. Also adds .gitea/workflows/ci.yml to build and push backend, frontend and agent on push to main.
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
# Continuous integration on git.menzel.center (Gitea Actions).
|
||||||
|
#
|
||||||
|
# Builds and pushes the three images to this instance's container registry
|
||||||
|
# on every push to main: backend, frontend, and agent (which is built FROM
|
||||||
|
# the backend image - see agent/Dockerfile - so it has to come after).
|
||||||
|
#
|
||||||
|
# Runs on ubuntu-latest, not the docker label: that label's image is a bare
|
||||||
|
# docker:24-dind with no Node/bash, which breaks actions/checkout (a JS
|
||||||
|
# action). ubuntu-latest has both a shell and the Docker CLI, talking to the
|
||||||
|
# host daemon through the socket the runner passes in.
|
||||||
|
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: git.menzel.center/menzeljonas
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CI_TOKEN }}
|
||||||
|
|
||||||
|
- name: Log in to the registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.CI_TOKEN }}" | docker login git.menzel.center -u menzeljonas --password-stdin
|
||||||
|
|
||||||
|
- name: Build and push backend
|
||||||
|
run: |
|
||||||
|
docker build -t "$REGISTRY/stackpilot-backend:latest" ./backend
|
||||||
|
docker push "$REGISTRY/stackpilot-backend:latest"
|
||||||
|
|
||||||
|
- name: Build and push frontend
|
||||||
|
run: |
|
||||||
|
docker build -t "$REGISTRY/stackpilot-frontend:latest" ./frontend
|
||||||
|
docker push "$REGISTRY/stackpilot-frontend:latest"
|
||||||
|
|
||||||
|
# Uses the backend image just pushed above as its base (already in the
|
||||||
|
# local Docker cache from that step, so this doesn't need to pull it).
|
||||||
|
- name: Build and push agent
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--build-arg "BACKEND_IMAGE=$REGISTRY/stackpilot-backend:latest" \
|
||||||
|
-t "$REGISTRY/stackpilot-agent:latest" \
|
||||||
|
./agent
|
||||||
|
docker push "$REGISTRY/stackpilot-agent:latest"
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# The agent reuses the backend image (same compose/Docker code + deps) and
|
# The agent reuses the backend image (same compose/Docker code + deps) and
|
||||||
# just runs a different ASGI app. Build the backend image first.
|
# just runs a different ASGI app. Build the backend image first.
|
||||||
ARG BACKEND_IMAGE=10.10.6.10:3020/menzelj/stackpilot-backend:latest
|
ARG BACKEND_IMAGE=git.menzel.center/menzeljonas/stackpilot-backend:latest
|
||||||
FROM ${BACKEND_IMAGE}
|
FROM ${BACKEND_IMAGE}
|
||||||
|
|
||||||
ENV STACKS_DIR=/opt/stacks \
|
ENV STACKS_DIR=/opt/stacks \
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
# token you enter when adding this host in the central StackPilot UI).
|
# token you enter when adding this host in the central StackPilot UI).
|
||||||
services:
|
services:
|
||||||
agent:
|
agent:
|
||||||
image: 10.10.6.10:3020/menzelj/stackpilot-agent:latest
|
image: git.menzel.center/menzeljonas/stackpilot-agent:latest
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
args:
|
args:
|
||||||
BACKEND_IMAGE: 10.10.6.10:3020/menzelj/stackpilot-backend:latest
|
BACKEND_IMAGE: git.menzel.center/menzeljonas/stackpilot-backend:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- AGENT_TOKEN=${AGENT_TOKEN:?set AGENT_TOKEN in .env}
|
- AGENT_TOKEN=${AGENT_TOKEN:?set AGENT_TOKEN in .env}
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
backend:
|
backend:
|
||||||
image: 10.10.6.10:3020/menzelj/stackpilot-backend:latest
|
image: git.menzel.center/menzeljonas/stackpilot-backend:latest
|
||||||
build: ./backend
|
build: ./backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
@@ -43,7 +43,7 @@ services:
|
|||||||
# - "5008:5008"
|
# - "5008:5008"
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: 10.10.6.10:3020/menzelj/stackpilot-frontend:latest
|
image: git.menzel.center/menzeljonas/stackpilot-frontend:latest
|
||||||
build: ./frontend
|
build: ./frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Reference in New Issue
Block a user