mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-17 10:35:11 +00:00
55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
name: Build Infrastructure Images
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- infrastructure
|
|
|
|
env:
|
|
GO_VERSION: "^1.21.0"
|
|
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:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2
|
|
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
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.${{ matrix.pkg }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: syncthing/${{ matrix.pkg }}:latest,syncthing/${{ matrix.pkg }}:${{ github.sha }}
|