Compare commits

...

12 Commits
0.1.0 ... 0.1.4

Author SHA1 Message Date
Herculino Trotta
023ceb898f Merge pull request #7
github(release): cache build process
2024-12-27 11:25:52 -03:00
Herculino Trotta
1243dddd5d github(release): cache build process 2024-12-27 11:24:56 -03:00
Herculino Trotta
8661fb39e8 github(release): disable provenance when building image 2024-12-27 11:20:44 -03:00
Herculino Trotta
5752606fec docker(prod): update docker-compose.prod.yml to use registry image 2024-12-27 11:20:14 -03:00
Herculino Trotta
7250ce0dbb Merge pull request #6
github(release): drop support for arm besides arm64
2024-12-27 03:24:25 -03:00
Herculino Trotta
b963a3cfb8 github(release): drop support for arm besides arm64 2024-12-27 03:23:51 -03:00
Herculino Trotta
1f14eb011f Merge pull request #5
github: fix "repository name must be lowercase"
2024-12-27 03:13:13 -03:00
Herculino Trotta
265af71ac5 github: fix "repository name must be lowercase" 2024-12-27 03:12:59 -03:00
Herculino Trotta
4c003d4456 Merge pull request #4
dev
2024-12-27 03:09:33 -03:00
Herculino Trotta
d66a2e2856 github: remove changelog creation from release.yml 2 2024-12-27 03:09:16 -03:00
Herculino Trotta
74bf6a655d Merge pull request #3
github: remove changelog creation from release.yml
2024-12-27 03:07:19 -03:00
Herculino Trotta
114cf2622e github: remove changelog creation from release.yml 2024-12-27 03:06:33 -03:00
3 changed files with 26 additions and 22 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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