Skip to content

Commit

Permalink
add conf for demo build
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Nov 23, 2023
1 parent 415be9b commit e8d29b3
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build_demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Update gh docker image and triggers

on:
# Triggers the workflow on releases
push:
branches:
- cekk_check_views
tags:
- "*"
pull_request:
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-image:
name: Build docker image
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get the image id
id: get_image_id
run: |
IMAGE_ID=$(echo ghcr.io/${{ github.repository }} | tr '[A-Z]' '[a-z]')
echo ::set-output name=IMAGE_ID::$IMAGE_ID
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

- name: Get the version
id: get_version
run: |
VERSION="${{ steps.extract_branch.outputs.branch }}"
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
echo ::set-output name=VERSION::$VERSION
- name: Build and push container image
uses: docker/build-push-action@v3
with:
context: .
file: {context}/Dockerfile.demo
push: true
tags: ${{ steps.get_image_id.outputs.IMAGE_ID }}:${{ steps.get_version.outputs.VERSION }}
platforms: linux/amd64,linux/arm64
11 changes: 11 additions & 0 deletions Dockerfile.demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM plone/plone-backend:6.0.4
COPY docker/create-constraints.py docker/constraints.cfg docker/requirements.txt requirements-rer.txt mx.ini /app/


COPY versions.cfg /

RUN python create-constraints.py constraints.cfg constraints.txt && \
./bin/pip install mxdev && \
./bin/mxdev -c mx.ini && \
./bin/pip install --ignore-requires-python -r requirements-mxdev.txt ${PIP_PARAMS} && \
find /app/lib -name LC_MESSAGES -exec chown -R plone:plone {} \;
11 changes: 11 additions & 0 deletions mx.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[settings]
requirements-in = requirements-iocomune.txt
requirements-out = requirements-mxdev.txt
contraints-out = constraints-mxdev.txt

# custom variables
github = https://github.com

[design.plone.contenttypes]
url = ${settings:github}/RedTurtle/design.plone.contenttypes.git
branch = cekk_check_views
2 changes: 2 additions & 0 deletions requirements-iocomune.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
-c constraints.txt

0 comments on commit e8d29b3

Please sign in to comment.