Compare commits
13 commits
ef972f891a
...
8c2f401f2e
Author | SHA1 | Date | |
---|---|---|---|
8c2f401f2e | |||
d581df4688 | |||
2b1f5bfbc1 | |||
b3882c32f5 | |||
c565047f5c | |||
6581639086 | |||
3336834daf | |||
f7f4cb359e | |||
9c49b0f07a | |||
ec0809f780 | |||
d2225333c0 | |||
0e2e3cd89d | |||
e460ac20a4 |
2 changed files with 51 additions and 39 deletions
66
.github/workflows/release_stable.yml
vendored
66
.github/workflows/release_stable.yml
vendored
|
@ -2,7 +2,7 @@ name: Build and push stable image
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
- cron: '15 10 * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
rebuild:
|
||||
|
@ -17,57 +17,47 @@ env:
|
|||
DOCKER_NAMESPACE: jcpd
|
||||
|
||||
jobs:
|
||||
check_release:
|
||||
check_image:
|
||||
name: Check and compare official Dotclear version
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
version: ${{ steps.dotclear.outputs.version }}
|
||||
exists: ${{ steps.repository.outputs.exists }}
|
||||
exists: ${{ steps.registry.outputs.image_exists }}
|
||||
steps:
|
||||
- name: Install required packages
|
||||
run: curl -sSL https://bit.ly/install-xq | sudo bash
|
||||
|
||||
- name: Download and parse last version
|
||||
id: dotclear
|
||||
run: |
|
||||
curl -sSL https://bit.ly/install-xq | sudo bash
|
||||
curl -fsSL -o versions.xml ${{ env.DOTCLEAR_URL }}
|
||||
echo version=$(cat versions.xml | xq -x "//release[@name='${{ env.DOTCLEAR_CANAL }}']/@version") >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Check registry image
|
||||
id: registry
|
||||
uses: k4kratik/container-image-check-custom-action@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
type: dockerhub
|
||||
container_repo_name: ${{ env.DOTCLEAR_IMAGE }}
|
||||
image_tag: ${{ steps.dotclear.outputs.version }}
|
||||
dockerhub_username: ${{ secrets.DOCKER_USERNAME }}
|
||||
dockerhub_token: ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Check repository releases
|
||||
id: repository
|
||||
uses: mukunku/tag-exists-action@v1.6.0
|
||||
with:
|
||||
tag: ${{ steps.dotclear.outputs.version }}
|
||||
- name: notfound
|
||||
if: (steps.registry.outputs.image_exists == 'false')
|
||||
run: |
|
||||
SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.version }} not found.'
|
||||
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
do_release:
|
||||
name: Create repository release according to Dotclear version
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
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
|
||||
- name: found
|
||||
if: (steps.registry.outputs.image_exists == 'true')
|
||||
run: |
|
||||
SUMMARY=$'Image ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ steps.dotclear.outputs.version }} found.'
|
||||
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
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
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
|
@ -75,8 +65,6 @@ jobs:
|
|||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
needs: check_release
|
||||
if: (needs.check_release.outputs.exists == 'false') || (github.event.inputs.rebuild == 'true')
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
|
@ -110,9 +98,9 @@ jobs:
|
|||
sbom: true
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }}
|
||||
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_image.outputs.version }}
|
||||
${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:latest
|
||||
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ needs.check_release.outputs.version }}
|
||||
ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ needs.check_image.outputs.version }}
|
||||
ghcr.io/${{ env.GITHUB_REPOSITORY }}:latest
|
||||
build-args: CANAL=${{ env.DOTCLEAR_CANAL }}
|
||||
platforms: linux/386,linux/amd64,linux/arm64,linux/arm/V7
|
||||
|
@ -127,4 +115,4 @@ jobs:
|
|||
to: ${{ secrets.TELEGRAM_ID }}
|
||||
token: ${{ secrets.TELEGRAM_TOKEN }}
|
||||
format: markdown
|
||||
message: Images __${{ env.DOTCLEAR_IMAGE }}:latest__ and __${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }}__ successfully generated.
|
||||
message: Images __${{ env.DOTCLEAR_IMAGE }}:latest__ and __${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_image.outputs.version }}__ successfully generated.
|
||||
|
|
24
.github/workflows/update_docker_readme.yml
vendored
Normal file
24
.github/workflows/update_docker_readme.yml
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
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
|
Loading…
Reference in a new issue