syncthing/.github/workflows/build-infra-dockers.yaml

55 lines
1.3 KiB
YAML
Raw Normal View History

2023-07-01 05:53:04 +00:00
name: Build Infrastructure Images
on:
push:
branches:
- infrastructure
env:
2023-09-06 19:10:58 +00:00
GO_VERSION: "~1.21.1"
2023-07-01 05:53:04 +00:00
CGO_ENABLED: "0"
BUILD_USER: docker
BUILD_HOST: github.syncthing.net
jobs:
docker-syncthing:
name: Build and push Docker images
runs-on: ubuntu-latest
environment: docker
strategy:
matrix:
pkg:
- stcrashreceiver
- strelaypoolsrv
- stupgrades
steps:
2023-09-05 07:52:19 +00:00
- uses: actions/checkout@v4
2023-07-01 05:53:04 +00:00
with:
fetch-depth: 0
- name: Login to Docker Hub
2023-09-25 19:50:17 +00:00
uses: docker/login-action@v3
2023-07-01 05:53:04 +00:00
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build binaries
run: |
for arch in arm64 amd64; do
go run build.go -goos linux -goarch "$arch" build ${{ matrix.pkg }}
mv ${{ matrix.pkg }} ${{ matrix.pkg }}-linux-"$arch"
done
- name: Set up Docker Buildx
2023-09-25 19:50:17 +00:00
uses: docker/setup-buildx-action@v3
2023-07-01 05:53:04 +00:00
- name: Build and push
2023-09-25 19:50:17 +00:00
uses: docker/build-push-action@v5
2023-07-01 05:53:04 +00:00
with:
context: .
file: ./Dockerfile.${{ matrix.pkg }}
platforms: linux/amd64,linux/arm64
push: true
tags: syncthing/${{ matrix.pkg }}:latest,syncthing/${{ matrix.pkg }}:${{ github.sha }}