2023-07-14 19:14:25 +00:00
|
|
|
name: Image Builder Template
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
push:
|
|
|
|
required: true
|
|
|
|
type: boolean
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Our build metadata
|
|
|
|
BUILD_USER: builder
|
|
|
|
BUILD_HOST: github.syncthing.net
|
|
|
|
# template var
|
|
|
|
image: ghcr.io/syncthing/syncthing-android-builder
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-image:
|
|
|
|
name: Build Builder Docker
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: true
|
2023-07-16 14:55:51 +00:00
|
|
|
fetch-depth: 0
|
2023-07-14 19:14:25 +00:00
|
|
|
|
|
|
|
- uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- uses: docker/login-action@v2
|
|
|
|
if: ${{ inputs.push }}
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./docker/Dockerfile
|
|
|
|
tags: '${{ env.image }}:latest,${{ env.image }}:${{ github.sha }}'
|
|
|
|
push: ${{ inputs.push }}
|