Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .github/workflows/dockerhub-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -23,11 +28,23 @@ 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.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
Expand All @@ -40,6 +57,7 @@ jobs:
tags: |
teamcompas/compas:${{ env.COMPAS_VERSION }}
teamcompas/compas: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

cache-to: type=gha,mode=max