aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2023-07-01 07:53:04 +0200
committerJakob Borg <jakob@kastelo.net>2023-07-01 08:23:55 +0200
commit5a1f996e56c2bd5d72974efe04819c5df4395dcf (patch)
treee559727b5f2db024669c5fb83b37b76f234934ef /.github
parent229b6a292c3b7844cbe38470deaca5f7cc63e631 (diff)
downloadsyncthing-5a1f996e56c2bd5d72974efe04819c5df4395dcf.tar.gz
syncthing-5a1f996e56c2bd5d72974efe04819c5df4395dcf.zip
build: Build infrastructure images
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build-infra-dockers.yaml54
1 files changed, 54 insertions, 0 deletions
diff --git a/.github/workflows/build-infra-dockers.yaml b/.github/workflows/build-infra-dockers.yaml
new file mode 100644
index 000000000..2295fedb1
--- /dev/null
+++ b/.github/workflows/build-infra-dockers.yaml
@@ -0,0 +1,54 @@
+name: Build Infrastructure Images
+
+on:
+ push:
+ branches:
+ - infrastructure
+
+env:
+ GO_VERSION: "^1.20.5"
+ 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 }}