Compare commits

..

12 commits

4 changed files with 123 additions and 4 deletions

View file

@ -3,6 +3,17 @@ on:
schedule:
- cron: '45 11 * * 0'
workflow_dispatch:
inputs:
days:
description: 'retain days'
required: true
default: 15
type: choice
options:
- 1
- 2
- 7
- 15
jobs:
del_runs:
@ -16,5 +27,5 @@ jobs:
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 30
retain_days: ${{ github.event.inputs.days }}
keep_minimum_runs: 7

70
.github/workflows/release_branch.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: Build and push image from branch
on:
workflow_dispatch:
env:
DOTCLEAR_IMAGE: docker-dotclear
DOCKER_NAMESPACE: jcpd
jobs:
build_image:
if: (github.ref_name != 'master')
name: Build and push selected version images
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Log in to Github registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: set lower case github repository
run: |
echo "GITHUB_REPOSITORY=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: '${{ github.repository }}'
- name: Build and push images
uses: docker/build-push-action@v6
with:
context: .
sbom: true
push: true
tags: |
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ github.ref_name }}
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ github.ref_name }}
build-args: CANAL=stable
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/V7
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Send Telegram Message Ok
uses: appleboy/telegram-action@master
env:
GITHUB_CONTEXT: ${{toJSON(github)}}
with:
to: ${{ secrets.TELEGRAM_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: Image __${{ env.DOTCLEAR_IMAGE }}:${{ github.ref_name }}__ successfully generated.

View file

@ -24,7 +24,8 @@ jobs:
contents: read
outputs:
version: ${{ steps.dotclear.outputs.version }}
exists: ${{ steps.registry.outputs.image_exists }}
has_image: ${{ steps.registry.outputs.image_exists }}
has_branch: ${{ steps.branch.outputs.exists }}
steps:
- name: Download and parse last version
id: dotclear
@ -43,6 +44,12 @@ jobs:
dockerhub_username: ${{ secrets.DOCKER_USERNAME }}
dockerhub_token: ${{ secrets.DOCKER_TOKEN }}
- name: Check repository branch
id: branch
uses: GuillaumeFalourd/branch-exists@v1.1
with:
branch: ${{ steps.dotclear.outputs.version }}
- name: notfound
if: (steps.registry.outputs.image_exists == 'false')
run: |
@ -55,9 +62,40 @@ jobs:
SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.version }} found.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
do_branch:
needs: check_image
if: ((needs.check_image.outputs.has_branch == 'false') || (github.event.inputs.force_rebuild == 'true'))
name: Create repository branch
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Create repository branch
id: create
uses: peterjgrainger/action-create-branch@v2.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: ${{ needs.check_image.outputs.version }}
- name: notfound
if: (steps.create.outputs.created == 'false')
run: |
SUMMARY=$'Branch ${{ needs.check_image.outputs.version }} has not been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
- name: found
if: (steps.create.outputs.created == 'true')
run: |
SUMMARY=$' Branch ${{ needs.check_image.outputs.version }} has been created.'
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
do_image:
needs: check_image
if: ((needs.check_image.outputs.exists == 'false') || (github.event.inputs.force_rebuild == 'true'))
if: ((needs.check_image.outputs.has_image == 'false') || (github.event.inputs.force_rebuild == 'true'))
name: Build and push latest and versionned images
runs-on: ubuntu-latest
permissions:

View file

@ -136,7 +136,7 @@ RUN curl -fsSL -o plugin.zip "https://github.com/JcDenis/dcLog/releases/download
&& rm plugin.zip
# sysInfo
ENV VER_SI=9.7
ENV VER_SI=9.8
RUN curl -fsSL -o plugin.zip "https://github.com/franck-paul/sysInfo/releases/download/$VER_SI/plugin-sysInfo-$VER_SI.zip" \
&& mkdir -p /var/lib/dotclear/plugins/sysInfo \
&& unzip -d /var/lib/dotclear/plugins plugin.zip \