-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add build and publish to org_nossas
- Loading branch information
1 parent
9459213
commit 49e1e73
Showing
5 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ on: | |
- main | ||
tags: | ||
- v* | ||
paths-ignore: | ||
- app/org_nossas/** | ||
|
||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish NOSSAS / CMS docker image | ||
on: | ||
push: | ||
paths: | ||
- 'app/contrib/**' | ||
- 'app/project/**' | ||
- 'app/tailwind/**' | ||
- 'app/admin_styled/**' | ||
- 'app/org_nossas/**' | ||
branches: | ||
- main | ||
- 'releases/**' | ||
- 'feature/**' | ||
- 'hotfix/**' | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: nossas/nossas-cms | ||
|
||
- name: Build and Push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./app | ||
file: Dockerfile.nossas | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Build staticfiles | ||
FROM node:18-alpine AS node-builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
WORKDIR /app/tailwind | ||
|
||
RUN npm i | ||
|
||
RUN npm run page:build | ||
|
||
RUN npm run admin:build | ||
|
||
# Use an official Python runtime based on Debian 10 "buster" as a parent image. | ||
FROM python:slim-buster | ||
|
||
# Port used by this container to serve HTTP. | ||
EXPOSE 8000 | ||
|
||
# Set environment variables. | ||
# 1. Force Python stdout and stderr streams to be unbuffered. | ||
# 2. Set PORT variable that is used by Gunicorn. This should match "EXPOSE" | ||
# command. | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PORT=8000 | ||
|
||
# Install system packages required by Django CMS and Django. | ||
RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \ | ||
build-essential \ | ||
cargo \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
sox \ | ||
ffmpeg \ | ||
libcairo2 \ | ||
libcairo2-dev \ | ||
python3-dev \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install the application server. | ||
RUN pip install uwsgi django-storages boto3 django-prometheus | ||
|
||
# Install the project requirements. | ||
COPY org_nossas/requirements.txt / | ||
RUN pip install -r requirements.txt | ||
|
||
# Use /app folder as a directory where the source code is stored. | ||
WORKDIR /app | ||
|
||
# Copy the source code of the project into the container. | ||
COPY --from=node-builder /app ./ | ||
|
||
RUN python manage.py collectstatic --noinput --clear -i tailwindcss | ||
|
||
# Runtime command that executes when "docker run" is called. | ||
|
||
# Check traefik + etcd configs to running domains | ||
ENV ENABLE_CHECK_TRAEFIK=True | ||
|
||
CMD ["uwsgi", "--ini", "/app/wsgi.ini"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
django==4.2 | ||
django-environ | ||
psycopg2-binary | ||
django-select2 | ||
django-compressor==4.4 | ||
django-sass-processor==1.4 | ||
django-entangled==0.5.4 | ||
django-formtools | ||
django-recaptcha==3 | ||
django-jsonform>=2.21.2 | ||
django-libsass==0.9 | ||
django-colorfield | ||
django-tag-fields | ||
django-admin-sortable2==2.1.10 | ||
# Django CMS | ||
django-cms==3.11.5 | ||
djangocms-admin-style==3.2.4 | ||
djangocms-text-ckeditor | ||
djangocms-picture | ||
djangocms-video | ||
djangocms_snippet | ||
djangocms-frontend>=1.2.1 | ||
django-prometheus | ||
# Authentication all platforms | ||
# django-allauth | ||
bcrypt | ||
whitenoise | ||
svglib | ||
reportlab | ||
django-social-share | ||
pyjwt | ||
requests | ||
# Domains | ||
etcd3-py>=0.1.6 | ||
dnspython>=2.4.2 | ||
# Nossas | ||
django-haystack==3.2.1 | ||
django-translated-fields>=0.12.0 | ||
git+https://github.com/nossas/djangocms-form-builder.git@feature/add-input-fields-on-form-plugin | ||
# Tests | ||
pytest | ||
pytest-django | ||
pytest-cov | ||
pytest-mock | ||
mock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters