From 6bb57a867843680615e4020188f62f7621e72cc9 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Thu, 22 May 2025 15:45:59 +0000 Subject: [PATCH 1/4] feat: add scheduled job to rebuild latest release Docker image --- .github/workflows/docker-image.yaml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 689c8c3..5be8490 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -3,6 +3,9 @@ name: "Create and publish docker image" on: release: types: [published] + schedule: + # Run at 2:00 AM UTC on the 1st of each month + - cron: '0 2 1 * *' permissions: contents: read @@ -12,8 +15,26 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Get latest release tag + if: github.event_name == 'schedule' + id: latest_release + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) + echo "RELEASE_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT + + - name: Set release tag variable + id: release_tag + run: | + if [ "${{ github.event_name }}" == "schedule" ]; then + echo "TAG=${{ steps.latest_release.outputs.RELEASE_TAG }}" >> $GITHUB_OUTPUT + else + echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT + fi + - name: Check out code uses: actions/checkout@v4 + with: + ref: ${{ steps.release_tag.outputs.TAG }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -49,4 +70,4 @@ jobs: file: docker/php/package.Dockerfile push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }},ghcr.io/${{ github.repository }}:latest + tags: ghcr.io/${{ github.repository }}:${{ steps.release_tag.outputs.TAG }},ghcr.io/${{ github.repository }}:latest \ No newline at end of file From 9d6fcebb55f95e0801a2c47b36955f732ea89ed7 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 27 May 2025 13:13:46 +0000 Subject: [PATCH 2/4] feat: enhance Docker image workflow to generate semantic version tags --- .github/workflows/docker-image.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index 5be8490..c0e4f28 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -30,6 +30,21 @@ jobs: else echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT fi + + - name: Generate semantic version tags + if: github.event_name == 'schedule' + id: semantic_tags + run: | + TAG=${{ steps.latest_release.outputs.RELEASE_TAG }} + # Remove 'v' prefix if present + VERSION=${TAG#v} + + # Extract major and minor versions + MAJOR=$(echo $VERSION | cut -d. -f1) + MINOR=$(echo $VERSION | cut -d. -f2) + + echo "MAJOR_TAG=$MAJOR" >> $GITHUB_OUTPUT + echo "MINOR_TAG=$MAJOR.$MINOR" >> $GITHUB_OUTPUT - name: Check out code uses: actions/checkout@v4 @@ -70,4 +85,8 @@ jobs: file: docker/php/package.Dockerfile push: true platforms: linux/amd64,linux/arm64 - tags: ghcr.io/${{ github.repository }}:${{ steps.release_tag.outputs.TAG }},ghcr.io/${{ github.repository }}:latest \ No newline at end of file + tags: | + ${{ github.event_name == 'release' && format('ghcr.io/{0}:{1}', github.repository, steps.release_tag.outputs.TAG) || '' }} + ${{ github.event_name == 'schedule' && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MAJOR_TAG) || '' }} + ${{ github.event_name == 'schedule' && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MINOR_TAG) || '' }} + ghcr.io/${{ github.repository }}:latest \ No newline at end of file From 373ed95af7524fc0ce11dfd2ee12500bb644c340 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 27 May 2025 13:17:41 +0000 Subject: [PATCH 3/4] feat: enable manual triggering of Docker image workflow --- .github/workflows/docker-image.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yaml b/.github/workflows/docker-image.yaml index c0e4f28..875e332 100644 --- a/.github/workflows/docker-image.yaml +++ b/.github/workflows/docker-image.yaml @@ -6,6 +6,7 @@ on: schedule: # Run at 2:00 AM UTC on the 1st of each month - cron: '0 2 1 * *' + workflow_dispatch: permissions: contents: read @@ -16,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Get latest release tag - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' id: latest_release run: | LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) @@ -25,14 +26,14 @@ jobs: - name: Set release tag variable id: release_tag run: | - if [ "${{ github.event_name }}" == "schedule" ]; then + if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "TAG=${{ steps.latest_release.outputs.RELEASE_TAG }}" >> $GITHUB_OUTPUT else echo "TAG=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT fi - name: Generate semantic version tags - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' id: semantic_tags run: | TAG=${{ steps.latest_release.outputs.RELEASE_TAG }} @@ -87,6 +88,6 @@ jobs: platforms: linux/amd64,linux/arm64 tags: | ${{ github.event_name == 'release' && format('ghcr.io/{0}:{1}', github.repository, steps.release_tag.outputs.TAG) || '' }} - ${{ github.event_name == 'schedule' && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MAJOR_TAG) || '' }} - ${{ github.event_name == 'schedule' && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MINOR_TAG) || '' }} + ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MAJOR_TAG) || '' }} + ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && format('ghcr.io/{0}:{1}', github.repository, steps.semantic_tags.outputs.MINOR_TAG) || '' }} ghcr.io/${{ github.repository }}:latest \ No newline at end of file From e9ff37a38d84b72e839d48960db495215cb6dc5c Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 27 May 2025 13:19:19 +0000 Subject: [PATCH 4/4] feat: document available Docker image tags and usage recommendations --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 4870877..4399cf7 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,16 @@ For example, you can trigger a package generation for your BitBucket project by You can run satisfy using prebuilt docker image. Here is an example how to setup it. +### Available Docker Image Tags + +The following Docker image tags are available: + +- **Specific version tags** (e.g., `3.7.0`, `3.6.1`): Immutable tags that point to exact release versions +- **Semantic version tags** (e.g., `3`, `3.7`): Moving tags that are automatically updated every 30 days to point to the latest stable release in that version series +- **`latest`**: Always points to the most recent stable release, rebuilt every 30 days + +**Recommendation**: Use specific version tags (e.g., `ghcr.io/project-satisfy/satisfy:3.7.0`) for production environments to ensure consistency, or semantic version tags (e.g., `ghcr.io/project-satisfy/satisfy:3.7`) if you want to automatically receive patch updates. + 1. Create dir for configuration files 2. Add parameters.yml file, can be copied from config/parameters.yml.dist 3. Add auth.json with all required composer authentication tokens