Skip to content

Commit db0a69a

Browse files
JOYclaude
andcommitted
ci: switch publish to ubuntu-latest, auto-trigger on version tags
- runs-on: build → ubuntu-latest (the build runner is gone) - Drop ARM cross-build, only linux/amd64 (DOScan deploys on x86_64) - Add on: push: tags: 'v*' so sync-upstream tag pushes auto-build - RELEASE_VERSION derived from tag name or workflow_dispatch input After this, when sync-upstream merges cleanly and pushes a vX.Y.Z tag, the image build fires automatically. Manual workflow_dispatch still works (with optional release_version input). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 72eaf53 commit db0a69a

1 file changed

Lines changed: 38 additions & 17 deletions

File tree

.github/workflows/publish-regular-docker-image-on-demand.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@ name: Publish regular Docker image on demand
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: 'Release version (e.g. 10.2.1). If empty and triggered by tag, derived from tag name.'
8+
required: false
9+
type: string
10+
push:
11+
tags:
12+
- 'v*'
13+
514
env:
615
OTP_VERSION: '27.3.4.6'
716
ELIXIR_VERSION: '1.19.4'
8-
RELEASE_VERSION: 10.2.1
917

1018
permissions:
1119
contents: read
@@ -14,17 +22,34 @@ permissions:
1422
jobs:
1523
push_to_registry:
1624
name: Push Docker image to GitHub Container Registry
17-
runs-on: build
25+
runs-on: ubuntu-latest
1826
steps:
1927
- uses: actions/checkout@v5
28+
29+
- name: Determine release version
30+
id: version
31+
env:
32+
INPUT_VERSION: ${{ inputs.release_version }}
33+
REF_NAME: ${{ github.ref_name }}
34+
REF_TYPE: ${{ github.ref_type }}
35+
run: |
36+
if [ -n "$INPUT_VERSION" ]; then
37+
VERSION="$INPUT_VERSION"
38+
elif [ "$REF_TYPE" = "tag" ]; then
39+
VERSION="${REF_NAME#v}"
40+
else
41+
echo "::error::No release_version input and not running on a tag"
42+
exit 1
43+
fi
44+
echo "release_version=$VERSION" >> "$GITHUB_OUTPUT"
45+
echo "Building RELEASE_VERSION=$VERSION"
46+
2047
- name: Setup repo
2148
uses: ./.github/actions/setup-repo
2249
id: setup
2350
with:
2451
github-token: ${{ secrets.GITHUB_TOKEN }}
25-
docker-remote-multi-platform: true
26-
docker-arm-host: ${{ secrets.ARM_RUNNER_HOSTNAME }}
27-
docker-arm-host-key: ${{ secrets.ARM_RUNNER_KEY }}
52+
docker-remote-multi-platform: false
2853

2954
- name: Build and push Docker image (indexer + API)
3055
uses: docker/build-push-action@v6
@@ -34,37 +59,33 @@ jobs:
3459
push: true
3560
cache-from: type=registry,ref=ghcr.io/dos/doscan:buildcache
3661
cache-to: type=registry,ref=ghcr.io/dos/doscan:buildcache,mode=max
37-
tags: ghcr.io/dos/doscan:${{ env.RELEASE_VERSION }}.commit.${{ env.SHORT_SHA }}
62+
tags: ghcr.io/dos/doscan:${{ steps.version.outputs.release_version }}.commit.${{ env.SHORT_SHA }}
3863
labels: ${{ steps.setup.outputs.docker-labels }}
39-
platforms: |
40-
linux/amd64
41-
linux/arm64/v8
64+
platforms: linux/amd64
4265
build-args: |
4366
DECODE_NOT_A_CONTRACT_CALLS=false
4467
MIXPANEL_URL=
4568
MIXPANEL_TOKEN=
4669
AMPLITUDE_URL=
4770
AMPLITUDE_API_KEY=
48-
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }}
49-
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
71+
BLOCKSCOUT_VERSION=v${{ steps.version.outputs.release_version }}.+commit.${{ env.SHORT_SHA }}
72+
RELEASE_VERSION=${{ steps.version.outputs.release_version }}
5073
5174
- name: Build and push Docker image (indexer)
5275
uses: docker/build-push-action@v6
5376
with:
5477
context: .
5578
file: ./docker/Dockerfile
5679
push: true
57-
tags: ghcr.io/dos/doscan:${{ env.RELEASE_VERSION }}.commit.${{ env.SHORT_SHA }}-indexer
80+
tags: ghcr.io/dos/doscan:${{ steps.version.outputs.release_version }}.commit.${{ env.SHORT_SHA }}-indexer
5881
labels: ${{ steps.setup.outputs.docker-labels }}
59-
platforms: |
60-
linux/amd64
61-
linux/arm64/v8
82+
platforms: linux/amd64
6283
build-args: |
6384
DISABLE_API=true
6485
DECODE_NOT_A_CONTRACT_CALLS=false
6586
MIXPANEL_URL=
6687
MIXPANEL_TOKEN=
6788
AMPLITUDE_URL=
6889
AMPLITUDE_API_KEY=
69-
BLOCKSCOUT_VERSION=v${{ env.RELEASE_VERSION }}.+commit.${{ env.SHORT_SHA }}
70-
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
90+
BLOCKSCOUT_VERSION=v${{ steps.version.outputs.release_version }}.+commit.${{ env.SHORT_SHA }}
91+
RELEASE_VERSION=${{ steps.version.outputs.release_version }}

0 commit comments

Comments
 (0)