File: build-docker.yml

package info (click to toggle)
colmap 3.12.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,928 kB
  • sloc: cpp: 101,944; ansic: 17,774; python: 4,958; sh: 366; makefile: 158
file content (56 lines) | stat: -rw-r--r-- 1,663 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: COLMAP (Docker)

on:
  push:
    branches:
      - main
      - release/*
  pull_request:
    types: [ assigned, opened, synchronize, reopened ]
  release:
    types: [ published, edited ]

env:
  IS_RELEASE: ${{ github.event_name == 'release' || startsWith(github.ref, 'refs/tags') }}

jobs:
  build:
    name: ubuntu-24.04
    runs-on: ubuntu-24.04
    steps:
      - 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 Docker Hub
        if: ${{ env.IS_RELEASE == 'true' }}
        uses: docker/login-action@v3
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - name: Build and push
        run: |
          dockertag=$(date +%Y%m%d).${{ github.run_number }}
          if [[ "${{ env.IS_RELEASE }}" == "true" ]]; then
            cuda_archs="50;60;70;75;90"
          else
            cuda_archs="50"
          fi
          if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
            GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
          fi
          docker build . \
            --file docker/Dockerfile \
            --tag colmap/colmap:$dockertag \
            --build-arg COLMAP_GIT_COMMIT="$GITHUB_SHA" \
            --build-arg CUDA_ARCHITECTURES="$cuda_archs"
          if [[ "${{ env.IS_RELEASE }}" == "true" ]]; then
            docker tag colmap/colmap:$dockertag colmap/colmap:latest
            docker push colmap/colmap:$dockertag
            docker push colmap/colmap:latest
          fi