mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
This commit is contained in:
2 files changed
+66
-2
No files matched your search
@@ -0,0 +1,64 @@
|
|||||||
|
name: build canary nocturne image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: cr.lmt.moe
|
||||||
|
TAG: canary
|
||||||
|
PROJECT: nocturne
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: setup builder
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: registry login
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: build containers
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
|
||||||
|
- name: tag and push
|
||||||
|
run: |
|
||||||
|
PROJECT_NAME=$(basename "$PWD")
|
||||||
|
|
||||||
|
ALL_IMAGES=$(docker compose -f prod.compose.yaml config --services 2>/dev/null)
|
||||||
|
PULLED_IMAGES=$(docker compose -f prod.compose.yaml config 2>/dev/null \
|
||||||
|
| awk '/image:/ {print $2}' \
|
||||||
|
| sort -u \
|
||||||
|
| sed 's/:.*//' \
|
||||||
|
)
|
||||||
|
TO_PUSH=$(comm -23 \
|
||||||
|
<(echo "$ALL_IMAGES" | sort) \
|
||||||
|
<(echo "$PULLED_IMAGES") \
|
||||||
|
)
|
||||||
|
|
||||||
|
FMT_STRING=$(echo "$TO_PUSH" | xargs printf '%s, ' | sed 's/, $//')
|
||||||
|
echo "services to push: $FMT_STRING"
|
||||||
|
|
||||||
|
for SERVICE in $TO_PUSH; do
|
||||||
|
LOCAL_TAG="${PROJECT_NAME}-${SERVICE}:latest"
|
||||||
|
REMOTE_TAG="${REGISTRY}/${PROJECT}/${SERVICE}:${TAG}"
|
||||||
|
|
||||||
|
if docker image inspect "$LOCAL_TAG" >/dev/null 2>&1; then
|
||||||
|
echo "Pushing $REMOTE_TAG"
|
||||||
|
docker tag "$LOCAL_TAG" "$REMOTE_TAG"
|
||||||
|
docker push "$REMOTE_TAG"
|
||||||
|
else
|
||||||
|
echo "warn: image $LOCAL_TAG not found, skipping $SERVICE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
+2
-2
@@ -7,7 +7,7 @@ services:
|
|||||||
dockerfile: ../container/release/frontend.containerfile
|
dockerfile: ../container/release/frontend.containerfile
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "0.0.0.0:3000:3000"
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ services:
|
|||||||
ARCH: ${ARCH}
|
ARCH: ${ARCH}
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3001:3001"
|
- "0.0.0.0:3001:3001"
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
- ./.env.local
|
- ./.env.local
|
||||||
|
|||||||
Reference in new issue
Block a user