aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build-infra-dockers.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-infra-dockers.yaml')
-rw-r--r--.github/workflows/build-infra-dockers.yaml15
1 files changed, 14 insertions, 1 deletions
diff --git a/.github/workflows/build-infra-dockers.yaml b/.github/workflows/build-infra-dockers.yaml
index b5dd18c10..9af9fc990 100644
--- a/.github/workflows/build-infra-dockers.yaml
+++ b/.github/workflows/build-infra-dockers.yaml
@@ -4,6 +4,7 @@ on:
push:
branches:
- infrastructure
+ - infra-*
env:
GO_VERSION: "~1.21.5"
@@ -14,6 +15,7 @@ env:
jobs:
docker-syncthing:
name: Build and push Docker images
+ if: github.repository == 'syncthing/syncthing'
runs-on: ubuntu-latest
environment: docker
strategy:
@@ -49,6 +51,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
+ - name: Set Docker tags (all branches)
+ run: |
+ tags=syncthing/${{ matrix.pkg }}:${{ github.sha }}
+ echo "TAGS=$tags" >> $GITHUB_ENV
+
+ - name: Set Docker tags (latest)
+ if: github.ref == 'refs/heads/infrastructure'
+ run: |
+ tags=syncthing/${{ matrix.pkg }}:latest,${{ env.TAGS }}
+ echo "TAGS=$tags" >> $GITHUB_ENV
+
- name: Build and push
uses: docker/build-push-action@v5
with:
@@ -56,6 +69,6 @@ jobs:
file: ./Dockerfile.${{ matrix.pkg }}
platforms: linux/amd64,linux/arm64
push: true
- tags: syncthing/${{ matrix.pkg }}:latest,syncthing/${{ matrix.pkg }}:${{ github.sha }}
+ tags: ${{ env.TAGS }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}