Skip to content

Commit

Permalink
build: Testing infra images for infra-* branches
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Jan 13, 2024
1 parent 8b32138 commit 36e08f8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build-infra-dockers.yaml
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- infrastructure
- infra-*

env:
GO_VERSION: "~1.21.5"
Expand All @@ -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:
Expand Down Expand Up @@ -49,13 +51,24 @@ 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:
context: .
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 }}

0 comments on commit 36e08f8

Please sign in to comment.