diff --git a/.github/workflows/build_demo.yml b/.github/workflows/build_demo.yml new file mode 100644 index 0000000..cc54e53 --- /dev/null +++ b/.github/workflows/build_demo.yml @@ -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 diff --git a/Dockerfile.demo b/Dockerfile.demo new file mode 100644 index 0000000..7cb526a --- /dev/null +++ b/Dockerfile.demo @@ -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 {} \; diff --git a/mx.ini b/mx.ini new file mode 100644 index 0000000..e675cf1 --- /dev/null +++ b/mx.ini @@ -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 diff --git a/requirements-iocomune.txt b/requirements-iocomune.txt new file mode 100644 index 0000000..17a9320 --- /dev/null +++ b/requirements-iocomune.txt @@ -0,0 +1,2 @@ +-r requirements.txt +-c constraints.txt