From 0ce685cefd64d6a4265c7e0cb24b83a04d2d2aee Mon Sep 17 00:00:00 2001 From: Zhanwei Wang Date: Wed, 19 Jun 2024 11:19:21 +0800 Subject: [PATCH] Add latest tag to image from default branch --- .github/workflows/check.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/image.yml | 1 + docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4bf60a2..241ffd2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/wangzw/cxx-cmake-project-template:main + image: ghcr.io/wangzw/cxx-cmake-project-template:latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 81427fc..54dd590 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/wangzw/cxx-cmake-project-template:main + image: ghcr.io/wangzw/cxx-cmake-project-template:latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 36820bf..1e2164f 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -27,6 +27,7 @@ jobs: type=ref,event=pr type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} + type=raw,value=latest,enable={{is_default_branch}} - name: Login to registry if: github.event_name != 'pull_request' diff --git a/docker-compose.yml b/docker-compose.yml index 9980119..1d0420e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: demo: - image: ghcr.io/wangzw/cxx-cmake-project-template:main + image: ghcr.io/wangzw/cxx-cmake-project-template:latest entrypoint: /usr/sbin/init hostname: demo restart: always