kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Unify docker build workflows
rodzic
c4a429d734
commit
0171bc9572
|
@ -1,44 +0,0 @@
|
||||||
name: Publish Docker Intel GPU
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
# Triggered by ODM build (after docker push)
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
# Use the repository information of the checked-out code to format docker tags
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: crazy-max/ghaction-docker-meta@v1
|
|
||||||
with:
|
|
||||||
images: opendronemap/nodeodm
|
|
||||||
tag-semver: |
|
|
||||||
{{version}}
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
file: ./Dockerfile.gpu.intel
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
opendronemap/nodeodm:gpu.intel
|
|
|
@ -1,44 +0,0 @@
|
||||||
name: Publish Docker GPU
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
|
|
||||||
# Triggered by ODM build (after docker push)
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
# Use the repository information of the checked-out code to format docker tags
|
|
||||||
- name: Docker meta
|
|
||||||
id: docker_meta
|
|
||||||
uses: crazy-max/ghaction-docker-meta@v1
|
|
||||||
with:
|
|
||||||
images: opendronemap/nodeodm
|
|
||||||
tag-semver: |
|
|
||||||
{{version}}
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: docker_build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
file: ./Dockerfile.gpu
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
opendronemap/nodeodm:gpu
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Publish Docker
|
name: Build, Test and Publish Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -6,12 +6,26 @@ on:
|
||||||
- master
|
- master
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
pull_request:
|
||||||
|
|
||||||
# Triggered by ODM build (after docker push)
|
# Triggered by ODM build (after docker push)
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
variant:
|
||||||
|
- dockerfile: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tag: latest
|
||||||
|
- dockerfile: ./Dockerfile.gpu
|
||||||
|
platforms: linux/amd64
|
||||||
|
tag: gpu
|
||||||
|
- dockerfile: ./Dockerfile.gpu.intel
|
||||||
|
platforms: linux/amd64
|
||||||
|
tag: gpu.intel
|
||||||
|
name: build ${{ matrix.variant.dockerfile }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -33,13 +47,30 @@ jobs:
|
||||||
images: opendronemap/nodeodm
|
images: opendronemap/nodeodm
|
||||||
tag-semver: |
|
tag-semver: |
|
||||||
{{version}}
|
{{version}}
|
||||||
- name: Build and push Docker image
|
- name: Build and export Docker image
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
file: ./Dockerfile
|
file: ${{ matrix.variant.dockerfile }}
|
||||||
platforms: linux/amd64,linux/arm64
|
# exporting is only supported for the native platform
|
||||||
|
# avoid rebuilding after the test
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
# make the image available to the docker command
|
||||||
|
load: true
|
||||||
|
tags: |
|
||||||
|
${{ matrix.variant.tag == 'latest' && steps.docker_meta.outputs.tags || '' }}
|
||||||
|
opendronemap/nodeodm:${{ matrix.variant.tag }}
|
||||||
|
- name: Test Powercycle
|
||||||
|
run: |
|
||||||
|
docker run --rm ${{ steps.docker_build.outputs.imageid }} --powercycle
|
||||||
|
- name: Push cached Docker image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
file: ${{ matrix.variant.dockerfile }}
|
||||||
|
platforms: ${{ matrix.variant.platforms }}
|
||||||
|
cache-from: type=gha
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ steps.docker_meta.outputs.tags }}
|
${{ matrix.variant.tag == 'latest' && steps.docker_meta.outputs.tags || '' }}
|
||||||
opendronemap/nodeodm:latest
|
opendronemap/nodeodm:${{ matrix.variant.tag }}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
name: Build PRs
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
services:
|
|
||||||
registry:
|
|
||||||
image: registry:2
|
|
||||||
ports:
|
|
||||||
- 5000:5000
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
- name: Build
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64
|
|
||||||
push: true
|
|
||||||
tags: localhost:5000/opendronemap/nodeodm:test
|
|
||||||
- name: Test Powercycle
|
|
||||||
run: |
|
|
||||||
docker run --rm localhost:5000/opendronemap/nodeodm:test --powercycle
|
|
Ładowanie…
Reference in New Issue