Skip to content

Commit 5725330

Browse files
committed
feat: optimize CI workflow with path-based triggers and tag consolidation
- Add paths filter to only trigger builds when version folders (25-30) or workflow files change - Consolidate 30-alpine and latest tags to avoid duplicate builds - Reduce unnecessary CI runs for documentation and unrelated file changes
1 parent 55a840f commit 5725330

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/bitcoin_core.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@ on:
55
branches:
66
- master
77
- dev
8+
paths:
9+
- '25/**'
10+
- '26/**'
11+
- '27/**'
12+
- '28/**'
13+
- '29/**'
14+
- '30/**'
15+
- '.github/workflows/bitcoin_core.yaml'
816
workflow_dispatch:
917
inputs:
1018
trigger:
1119
description: "Trigger the workflow manually"
1220

21+
env:
22+
LATEST_VERSION: "30-alpine"
23+
1324
jobs:
1425
build:
1526
runs-on: ubuntu-latest
@@ -56,8 +67,6 @@ jobs:
5667
context: "./30/debian"
5768
- name: 30-ubuntu
5869
context: "./30/ubuntu"
59-
- name: latest
60-
context: "./30/alpine"
6170
steps:
6271
- name: Checkout
6372
uses: actions/checkout@v4
@@ -77,3 +86,12 @@ jobs:
7786
platforms: linux/amd64,linux/arm64
7887
push: true
7988
tags: ${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:${{ matrix.image.name }}
89+
- name: Tag and push latest
90+
if: matrix.image.name == env.LATEST_VERSION
91+
run: |
92+
# create latest tag & push
93+
echo "Creating latest tag for ${{ env.LATEST_VERSION }}"
94+
docker buildx imagetools create \
95+
${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:${{ env.LATEST_VERSION }} \
96+
--tag ${{ vars.DOCKERHUB_USERNAME }}/${{ vars.DOCKERHUB_REPO }}:latest
97+
echo "Latest tag created successfully"

0 commit comments

Comments
 (0)