Compare commits

..

No commits in common. "8c2f401f2e3ca721f4a1bd140d6d93c37224ea4a" and "ef972f891a79964c20f58d883dd769baa1501dbf" have entirely different histories.

2 changed files with 39 additions and 51 deletions

View file

@ -2,7 +2,7 @@ name: Build and push stable image
on: on:
schedule: schedule:
- cron: '15 10 * * *' - cron: '0 10 * * *'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
rebuild: rebuild:
@ -17,47 +17,57 @@ env:
DOCKER_NAMESPACE: jcpd DOCKER_NAMESPACE: jcpd
jobs: jobs:
check_image: check_release:
name: Check and compare official Dotclear version name: Check and compare official Dotclear version
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
outputs: outputs:
version: ${{ steps.dotclear.outputs.version }} version: ${{ steps.dotclear.outputs.version }}
exists: ${{ steps.registry.outputs.image_exists }} exists: ${{ steps.repository.outputs.exists }}
steps: steps:
- name: Install required packages
run: curl -sSL https://bit.ly/install-xq | sudo bash
- name: Download and parse last version - name: Download and parse last version
id: dotclear id: dotclear
run: | run: |
curl -sSL https://bit.ly/install-xq | sudo bash
curl -fsSL -o versions.xml ${{ env.DOTCLEAR_URL }} curl -fsSL -o versions.xml ${{ env.DOTCLEAR_URL }}
echo version=$(cat versions.xml | xq -x "//release[@name='${{ env.DOTCLEAR_CANAL }}']/@version") >> $GITHUB_OUTPUT echo version=$(cat versions.xml | xq -x "//release[@name='${{ env.DOTCLEAR_CANAL }}']/@version") >> $GITHUB_OUTPUT
- name: Check registry image - name: Check out the repo
id: registry uses: actions/checkout@v4
uses: k4kratik/container-image-check-custom-action@v4
with: with:
type: dockerhub fetch-depth: 0
container_repo_name: ${{ env.DOTCLEAR_IMAGE }}
image_tag: ${{ steps.dotclear.outputs.version }}
dockerhub_username: ${{ secrets.DOCKER_USERNAME }}
dockerhub_token: ${{ secrets.DOCKER_TOKEN }}
- name: notfound - name: Check repository releases
if: (steps.registry.outputs.image_exists == 'false') id: repository
run: | uses: mukunku/tag-exists-action@v1.6.0
SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.version }} not found.' with:
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY tag: ${{ steps.dotclear.outputs.version }}
- name: found do_release:
if: (steps.registry.outputs.image_exists == 'true') name: Create repository release according to Dotclear version
run: | runs-on: ubuntu-latest
SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.version }} found.' permissions:
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY contents: write
needs: check_release
if: needs.check_release.outputs.exists == 'false'
steps:
- name: Check out the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create repository release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.check_release.outputs.version }}
tag_name: ${{ needs.check_release.outputs.version }}
draft: false
prerelease: false
do_image: do_image:
needs: check_image
if: ((needs.check_image.outputs.exists == 'false') || (github.event.inputs.rebuild == 'true'))
name: Build and push latest and versionned images name: Build and push latest and versionned images
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
@ -65,6 +75,8 @@ jobs:
contents: read contents: read
attestations: write attestations: write
id-token: write id-token: write
needs: check_release
if: (needs.check_release.outputs.exists == 'false') || (github.event.inputs.rebuild == 'true')
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -98,9 +110,9 @@ jobs:
sbom: true sbom: true
push: true push: true
tags: | tags: |
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_image.outputs.version }} ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }}
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:latest ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:latest
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ needs.check_image.outputs.version }} ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ needs.check_release.outputs.version }}
ghcr.io/${{ env.GITHUB_REPOSITORY }}:latest ghcr.io/${{ env.GITHUB_REPOSITORY }}:latest
build-args: CANAL=${{ env.DOTCLEAR_CANAL }} build-args: CANAL=${{ env.DOTCLEAR_CANAL }}
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/V7 platforms: linux/386,linux/amd64,linux/arm64,linux/arm/V7
@ -115,4 +127,4 @@ jobs:
to: ${{ secrets.TELEGRAM_ID }} to: ${{ secrets.TELEGRAM_ID }}
token: ${{ secrets.TELEGRAM_TOKEN }} token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown format: markdown
message: Images __${{ env.DOTCLEAR_IMAGE }}:latest__ and __${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_image.outputs.version }}__ successfully generated. message: Images __${{ env.DOTCLEAR_IMAGE }}:latest__ and __${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }}__ successfully generated.

View file

@ -1,24 +0,0 @@
name: Update Docker Hub Description
on:
push:
branches:
- master
paths:
- README.md
workflow_dispatch:
jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: jcpd/docker-dotclear
short-description: ${{ github.event.repository.description }}
readme-filepath: ./README.md
enable-url-completion: true