From 2832275361b87acf32c09fa9477313bccf982c34 Mon Sep 17 00:00:00 2001 From: avi Date: Thu, 7 Aug 2025 17:05:53 +1200 Subject: [PATCH 1/3] add: GHCR push --- .github/workflows/dockerhub-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerhub-ci.yml b/.github/workflows/dockerhub-ci.yml index f032aa9a7..c78b42c11 100755 --- a/.github/workflows/dockerhub-ci.yml +++ b/.github/workflows/dockerhub-ci.yml @@ -23,6 +23,13 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + - name: Get release version run: echo "COMPAS_VERSION=$(sed -n '/const std::string VERSION_STRING/,/^$/p' ./src/changelog.h | sed 's/.*"\(.*\)"[^"]*$/\1/')" >> $GITHUB_ENV @@ -40,6 +47,7 @@ jobs: tags: | teamcompas/compas:${{ env.COMPAS_VERSION }} teamcompas/compas:latest + ghcr.io/${{ github.repository }}:${{ env.COMPAS_VERSION }} + ghcr.io/${{ github.repository }}:latest cache-from: type=gha - cache-to: type=gha,mode=max - + cache-to: type=gha,mode=max \ No newline at end of file From 29a667ab20ade723bbf8c500ba17dfc234b1368b Mon Sep 17 00:00:00 2001 From: avi Date: Tue, 19 Aug 2025 20:40:28 +1200 Subject: [PATCH 2/3] add Github container repo to docker CI --- .github/workflows/dockerhub-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub-ci.yml b/.github/workflows/dockerhub-ci.yml index c78b42c11..945f2e865 100755 --- a/.github/workflows/dockerhub-ci.yml +++ b/.github/workflows/dockerhub-ci.yml @@ -5,6 +5,11 @@ on: branches: [ dev ] workflow_dispatch: null +# Add permissions for the built-in GITHUB_TOKEN +permissions: + contents: read + packages: write + # Ensures only the latest workflow run for the same branch is active, canceling any in-progress runs. concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -28,7 +33,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GHCR_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} # Changed from GHCR_TOKEN - name: Get release version run: echo "COMPAS_VERSION=$(sed -n '/const std::string VERSION_STRING/,/^$/p' ./src/changelog.h | sed 's/.*"\(.*\)"[^"]*$/\1/')" >> $GITHUB_ENV From c6712f107ce819a02e5ea7bf2ab8e15243eacc94 Mon Sep 17 00:00:00 2001 From: avi Date: Tue, 19 Aug 2025 20:45:32 +1200 Subject: [PATCH 3/3] add lowercase for GHCR --- .github/workflows/dockerhub-ci.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dockerhub-ci.yml b/.github/workflows/dockerhub-ci.yml index 945f2e865..e441367fc 100755 --- a/.github/workflows/dockerhub-ci.yml +++ b/.github/workflows/dockerhub-ci.yml @@ -33,13 +33,18 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} # Changed from GHCR_TOKEN + password: ${{ secrets.GITHUB_TOKEN }} - name: Get release version run: echo "COMPAS_VERSION=$(sed -n '/const std::string VERSION_STRING/,/^$/p' ./src/changelog.h | sed 's/.*"\(.*\)"[^"]*$/\1/')" >> $GITHUB_ENV - - name: Print version - run: echo $COMPAS_VERSION + - name: Set lowercase repository name + run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV + + - name: Print version and repo + run: | + echo "Version: $COMPAS_VERSION" + echo "Lowercase repo: $REPO_LC" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -52,7 +57,7 @@ jobs: tags: | teamcompas/compas:${{ env.COMPAS_VERSION }} teamcompas/compas:latest - ghcr.io/${{ github.repository }}:${{ env.COMPAS_VERSION }} - ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ env.REPO_LC }}:${{ env.COMPAS_VERSION }} + ghcr.io/${{ env.REPO_LC }}:latest cache-from: type=gha cache-to: type=gha,mode=max \ No newline at end of file