mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-23 17:18:44 +02:00
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
@@ -34,13 +34,29 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/prod/django/Dockerfile
|
file: ./docker/prod/django/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
|
provenance: false
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
|
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
|
||||||
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
|
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
|
||||||
platforms: linux/amd64,linux/arm64
|
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:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./docker/prod/django/Dockerfile
|
dockerfile: ./docker/prod/django/Dockerfile
|
||||||
image: ${SERVER_NAME}
|
image: ghcr.io/eitchtee/wygiwyh:latest
|
||||||
container_name: ${SERVER_NAME}
|
container_name: ${SERVER_NAME}
|
||||||
command: /start
|
command: /start
|
||||||
ports:
|
ports:
|
||||||
@@ -27,7 +27,6 @@ services:
|
|||||||
|
|
||||||
procrastinate:
|
procrastinate:
|
||||||
<<: *django
|
<<: *django
|
||||||
image: ${PROCRASTINATE_NAME}
|
|
||||||
container_name: ${PROCRASTINATE_NAME}
|
container_name: ${PROCRASTINATE_NAME}
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY ./requirements.txt .
|
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
|
FROM node:lts-alpine AS webpack_build
|
||||||
WORKDIR /usr/src/frontend
|
WORKDIR /usr/src/frontend
|
||||||
COPY ./frontend .
|
COPY ./frontend .
|
||||||
COPY ./app/templates /usr/src/app/templates
|
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 install --verbose && \
|
||||||
npm run build && \
|
npm run build
|
||||||
npm cache clean --force
|
|
||||||
|
|
||||||
FROM python:3.11-slim-buster AS python-run-stage
|
FROM python:3.11-slim-buster AS python-run-stage
|
||||||
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
|
COPY --from=webpack_build /usr/src/frontend/build /usr/src/frontend/build
|
||||||
@@ -29,12 +29,13 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|||||||
PYTHONUNBUFFERED=1
|
PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
COPY --from=python-build-stage /usr/src/app/wheels /wheels/
|
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 && \
|
apt-get install --no-install-recommends -y gettext && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
rm -rf /var/lib/apt/lists/* && \
|
||||||
pip install --upgrade pip && \
|
pip install --upgrade pip && \
|
||||||
pip install --no-cache-dir --no-index --find-links=/wheels/ /wheels/* && \
|
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/django/start /start
|
||||||
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate
|
COPY --chown=app:app ./docker/prod/procrastinate/start /start-procrastinate
|
||||||
|
|||||||
Reference in New Issue
Block a user