mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-02-25 17:04:51 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
023ceb898f | ||
|
|
1243dddd5d | ||
|
|
8661fb39e8 | ||
|
|
5752606fec | ||
|
|
7250ce0dbb | ||
|
|
b963a3cfb8 | ||
|
|
1f14eb011f | ||
|
|
265af71ac5 | ||
|
|
4c003d4456 | ||
|
|
d66a2e2856 | ||
|
|
74bf6a655d | ||
|
|
114cf2622e |
32
.github/workflows/release.yml
vendored
32
.github/workflows/release.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: WYGIWYH
|
||||
IMAGE_NAME: wygiwyh
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
@@ -21,18 +21,6 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
uses: metcalfc/changelog-generator@v4.1.0
|
||||
with:
|
||||
myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update release with changelog
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body: ${{ steps.changelog.outputs.changelog }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
@@ -46,13 +34,29 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/prod/django/Dockerfile
|
||||
push: true
|
||||
provenance: false
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
|
||||
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v8,linux/arm64/v8
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
|
||||
@@ -3,7 +3,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/prod/django/Dockerfile
|
||||
image: ${SERVER_NAME}
|
||||
image: ghcr.io/eitchtee/wygiwyh:latest
|
||||
container_name: ${SERVER_NAME}
|
||||
command: /start
|
||||
ports:
|
||||
@@ -27,7 +27,6 @@ services:
|
||||
|
||||
procrastinate:
|
||||
<<: *django
|
||||
image: ${PROCRASTINATE_NAME}
|
||||
container_name: ${PROCRASTINATE_NAME}
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
@@ -6,16 +6,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY ./requirements.txt .
|
||||
RUN pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip wheel --wheel-dir /usr/src/app/wheels -r requirements.txt
|
||||
|
||||
FROM node:lts-alpine AS webpack_build
|
||||
WORKDIR /usr/src/frontend
|
||||
COPY ./frontend .
|
||||
COPY ./app/templates /usr/src/app/templates
|
||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm install --verbose && \
|
||||
npm run build && \
|
||||
npm cache clean --force
|
||||
npm run build
|
||||
|
||||
FROM python:3.11-slim-buster AS python-run-stage
|
||||
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
|
||||
@@ -29,12 +29,13 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
||||
RUN apt-get update && \
|
||||
RUN --mount=type=cache,target=/root/.cache/apt \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y gettext && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
pip install --upgrade pip && \
|
||||
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
||||
rm -rf /wheels/ ~/.cache/pip/*
|
||||
rm -rf /wheels/
|
||||
|
||||
COPY --chown=app:app ./docker/prod/django/start /start
|
||||
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate
|
||||
|
||||
Reference in New Issue
Block a user