mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-03 16:51:32 +00:00
Add GHA workflow to build the builder image
This commit is contained in:
parent
d753c2659f
commit
f257bd3cb7
2 changed files with 58 additions and 0 deletions
18
.github/workflows/build.yaml
vendored
Normal file
18
.github/workflows/build.yaml
vendored
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
name: Build/Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-image:
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
uses: ./.github/workflows/image-builder-template.yaml
|
||||||
|
with:
|
||||||
|
push: false
|
||||||
|
|
||||||
|
push-image:
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
|
uses: ./.github/workflows/image-builder-template.yaml
|
||||||
|
with:
|
||||||
|
push: true
|
40
.github/workflows/image-builder-template.yaml
vendored
Normal file
40
.github/workflows/image-builder-template.yaml
vendored
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
- 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 }}
|
Loading…
Reference in a new issue