2023-07-01 05:53:04 +00:00
|
|
|
name: Build Infrastructure Images
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- infrastructure
|
|
|
|
|
|
|
|
env:
|
2023-11-14 06:46:14 +00:00
|
|
|
GO_VERSION: "~1.21.1"
|
|
|
|
CGO_ENABLED: "0"
|
|
|
|
BUILD_USER: docker
|
|
|
|
BUILD_HOST: github.syncthing.net
|
2023-07-01 05:53:04 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker-syncthing:
|
|
|
|
name: Build and push Docker images
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: docker
|
|
|
|
strategy:
|
2023-11-14 06:46:14 +00:00
|
|
|
matrix:
|
|
|
|
pkg:
|
|
|
|
- stcrashreceiver
|
|
|
|
- strelaypoolsrv
|
|
|
|
- stupgrades
|
2023-07-01 05:53:04 +00:00
|
|
|
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 }}
|
2023-11-14 06:46:14 +00:00
|
|
|
outputs: |
|
|
|
|
annotation.org.opencontainers.image.revision="${{ github.sha }}"
|