Compare commits
2 Commits
7061e78305
...
5534a25ce5
| Author | SHA1 | Date | |
|---|---|---|---|
| 5534a25ce5 | |||
| f05be2a5bf |
@@ -1,4 +1,7 @@
|
|||||||
name: Build Backend
|
name: Build Backend
|
||||||
|
env:
|
||||||
|
MAJOR: 1
|
||||||
|
MINOR: 0
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -36,10 +39,28 @@ jobs:
|
|||||||
# Tells the action to use the local 'git' binary we just installed
|
# Tells the action to use the local 'git' binary we just installed
|
||||||
set-safe-directory: 'true'
|
set-safe-directory: 'true'
|
||||||
|
|
||||||
|
- name: Determine Version
|
||||||
|
run: |
|
||||||
|
LATEST_TAG=$(git tag -l "v${{ env.MAJOR }}.${{ env.MINOR }}.*" | sort -V | tail -n 1)
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
VERSION="v${{ env.MAJOR }}.${{ env.MINOR }}.0"
|
||||||
|
else
|
||||||
|
# Strip the 'v' if present and get the patch version
|
||||||
|
PATCH=$(echo "$LATEST_TAG" | sed 's/v//' | cut -d'.' -f3)
|
||||||
|
NEW_PATCH=$((PATCH + 1))
|
||||||
|
VERSION="v${{ env.MAJOR }}.${{ env.MINOR }}.$NEW_PATCH"
|
||||||
|
fi
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
-t gitea.lan/jacobh2/babymonitor:backend-latest \
|
-t gitea.lan/jacobh2/babymonitor-backend:${{ env.VERSION }} \
|
||||||
./backend \
|
./backend \
|
||||||
--push
|
--push
|
||||||
|
|
||||||
|
- name: Tag and Push Version
|
||||||
|
run: |
|
||||||
|
git tag $VERSION
|
||||||
|
git push origin $VERSION
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
name: Build Frontend
|
name: Build Frontend
|
||||||
|
env:
|
||||||
|
MAJOR: 1
|
||||||
|
MINOR: 0
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -36,10 +39,28 @@ jobs:
|
|||||||
# Tells the action to use the local 'git' binary we just installed
|
# Tells the action to use the local 'git' binary we just installed
|
||||||
set-safe-directory: 'true'
|
set-safe-directory: 'true'
|
||||||
|
|
||||||
|
- name: Determine Version
|
||||||
|
run: |
|
||||||
|
LATEST_TAG=$(git tag -l "v${{ env.MAJOR }}.${{ env.MINOR }}.*" | sort -V | tail -n 1)
|
||||||
|
if [ -z "$LATEST_TAG" ]; then
|
||||||
|
VERSION="v${{ env.MAJOR }}.${{ env.MINOR }}.0"
|
||||||
|
else
|
||||||
|
# Strip the 'v' if present and get the patch version
|
||||||
|
PATCH=$(echo "$LATEST_TAG" | sed 's/v//' | cut -d'.' -f3)
|
||||||
|
NEW_PATCH=$((PATCH + 1))
|
||||||
|
VERSION="v${{ env.MAJOR }}.${{ env.MINOR }}.$NEW_PATCH"
|
||||||
|
fi
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/arm64 \
|
--platform linux/arm64 \
|
||||||
-t gitea.lan/jacobh2/babymonitor:frontend-latest \
|
-t gitea.lan/jacobh2/babymonitor-frontend:${{ env.VERSION }} \
|
||||||
./frontend \
|
./frontend \
|
||||||
--push
|
--push
|
||||||
|
|
||||||
|
- name: Tag and Push Version
|
||||||
|
run: |
|
||||||
|
git tag $VERSION
|
||||||
|
git push origin $VERSION
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ COPY pyproject.toml README.md ./
|
|||||||
RUN pip install --no-cache-dir .
|
RUN pip install --no-cache-dir .
|
||||||
|
|
||||||
FROM base
|
FROM base
|
||||||
|
LABEL org.opencontainers.image.source="http://gitea.lan/jacobh2/babymonitor"
|
||||||
|
LABEL org.opencontainers.image.description="Babymonitor Backend"
|
||||||
|
|
||||||
# Copy installed packages from builder
|
# Copy installed packages from builder
|
||||||
COPY --from=builder /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
|
COPY --from=builder /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
|
||||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ RUN npm run build
|
|||||||
# Stage 2: Production stage
|
# Stage 2: Production stage
|
||||||
FROM nginx:1.27-alpine
|
FROM nginx:1.27-alpine
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source="http://gitea.lan/jacobh2/babymonitor"
|
||||||
|
LABEL org.opencontainers.image.description="Babymonitor Frontend"
|
||||||
|
|
||||||
# Copy the built assets from the build stage to Nginx's default HTML directory
|
# Copy the built assets from the build stage to Nginx's default HTML directory
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user