From 35caf14405d3f01ddde800ba8bd0c2254d96a688 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 24 Nov 2024 09:09:21 +0100 Subject: [PATCH] add ghcr registry --- .github/workflows/release_stable.yml | 24 ++++++++++++++++++++---- .github/workflows/release_testing.yml | 22 +++++++++++++++++++--- .github/workflows/release_unstable.yml | 6 +++--- README.md | 4 ++-- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release_stable.yml b/.github/workflows/release_stable.yml index 9260ac6..a4ce34c 100644 --- a/.github/workflows/release_stable.yml +++ b/.github/workflows/release_stable.yml @@ -11,9 +11,10 @@ on: required: true env: - DOTCLEAR_IMAGE: jcpd/docker-dotclear + DOTCLEAR_IMAGE: docker-dotclear DOTCLEAR_CANAL: stable DOTCLEAR_URL: https://download.dotclear.org/versions.xml + DOCKER_NAMESPACE: jcpd jobs: check_release: @@ -63,7 +64,7 @@ jobs: prerelease: false do_image: - name: Build latest and versionned images and push to Docker hub + name: Build and push latest and versionned images runs-on: ubuntu-latest permissions: packages: write @@ -85,6 +86,19 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + - name: Log in to Github registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + 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: @@ -92,8 +106,10 @@ jobs: sbom: true push: true tags: | - ${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }} - ${{ env.DOTCLEAR_IMAGE }}:latest + ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ needs.check_release.outputs.version }} + ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:latest + ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ needs.check_release.outputs.version }} + ghcr.io/${{ env.GITHUB_REPOSITORY }}:latest build-args: CANAL=${{ env.DOTCLEAR_CANAL }} platforms: linux/386,linux/amd64,linux/arm/V6 diff --git a/.github/workflows/release_testing.yml b/.github/workflows/release_testing.yml index 0536b17..8aa1ff5 100644 --- a/.github/workflows/release_testing.yml +++ b/.github/workflows/release_testing.yml @@ -6,12 +6,13 @@ on: workflow_dispatch: env: - DOTCLEAR_IMAGE: jcpd/docker-dotclear + DOTCLEAR_IMAGE: docker-dotclear DOTCLEAR_CANAL: testing + DOCKER_NAMESPACE: jcpd jobs: do_image: - name: Build testing image and push to Docker hub + name: Build and push testing image runs-on: ubuntu-latest permissions: packages: write @@ -31,13 +32,28 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + - name: Log in to Github registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + 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 image uses: docker/build-push-action@v6 with: context: . sbom: true push: true - tags: ${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }} + tags: | + ${{ env.DOCKER_NAMESPACE }}/${{ env.DOTCLEAR_IMAGE }}:${{ env.DOTCLEAR_CANAL }} + ghcr.io/${{ env.GITHUB_REPOSITORY }}:${{ env.DOTCLEAR_CANAL }} build-args: CANAL=${{ env.DOTCLEAR_CANAL }} platforms: linux/386,linux/amd64,linux/arm/V6 diff --git a/.github/workflows/release_unstable.yml b/.github/workflows/release_unstable.yml index 4e1c6c7..61df3a7 100644 --- a/.github/workflows/release_unstable.yml +++ b/.github/workflows/release_unstable.yml @@ -12,7 +12,7 @@ env: jobs: do_image: - name: Build dev image and push to Docker hub + name: Build and push dev image runs-on: ubuntu-latest permissions: packages: write @@ -32,14 +32,14 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} - - name: Log in to the Container registry + - name: Log in to Github registry uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: set lower case owner name + - name: set lower case github repository run: | echo "GITHUB_REPOSITORY=${REPO,,}" >>${GITHUB_ENV} env: diff --git a/README.md b/README.md index 0533594..a91c8b2 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ tool allowing anyone to publish on the web, regardless of their technical skills This repository contains all features to build or run Dotclear on a Docker environment. It is hightly based on work from [darknao](https://github.com/darknao/docker-dotclear). -* Dotclear docker images are avaialable at [Docker hub](https://hub.docker.com/r/jcpd/docker-dotclear) +* Dotclear docker images are avaialable at [Docker hub](https://hub.docker.com/r/jcpd/docker-dotclear) or [Github registry](https://github.com/JcDenis?tab=packages&repo_name=docker-dotclear) * Dotclear docker sources are avaialable at [Github repository](https://github.com/JcDenis/docker-dotclear) ### TAGS @@ -42,7 +42,7 @@ It is composed of Dotclear version or release type: * testing: The latest dev of Dotclear stable branch * dev : A Dotclear unstable (nightly) release -### Builds +### BUILDS Clone this repository: