File: docker.yml

package info (click to toggle)
labgrid 25.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,796 kB
  • sloc: python: 21,352; sh: 846; makefile: 35
file content (51 lines) | stat: -rw-r--r-- 1,564 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
name: docker build

on:
  push:
    branches: [ master ]
    tags:
      - '*'
  release:
    types: [ released ]
  workflow_dispatch:

env:
    QEMU_PLATFORMS: arm64
    IMAGE_PLATFORMS: linux/amd64,linux/arm64
    IMAGE_PREFIX: ${{ secrets.DOCKERHUB_PREFIX }}

jobs:
  docker:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v4
    - uses: docker/setup-compose-action@v1
      with:
        version: latest
    - name: Install system dependencies
      run: |
        sudo apt install -yq python3-pip python3-setuptools-scm
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v3
      with:
        platforms: ${QEMU_PLATFORMS}
    - 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 }}
    - name: Build amd64 docker image and validate
      run: |
        ./dockerfiles/build.sh --load
        docker compose -f dockerfiles/staging/docker-compose.yml up --exit-code-from client client
        docker compose -f dockerfiles/staging/docker-compose.yml down
        docker images
    - name: Build, tag and push latest image for all platforms
      run: ./dockerfiles/build.sh --platform ${IMAGE_PLATFORMS} --push
    - name: Tag and push release image for all platforms
      if: startsWith(github.ref, 'refs/tags')
      env:
        IMAGE_TAG: ${{ github.ref_name }}
      run: ./dockerfiles/build.sh --platform ${IMAGE_PLATFORMS} --push