File: docker.yml

package info (click to toggle)
casacore 3.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,908 kB
  • sloc: cpp: 471,569; fortran: 16,372; ansic: 7,416; yacc: 4,714; lex: 2,346; sh: 1,865; python: 629; perl: 531; sed: 499; csh: 201; makefile: 32
file content (65 lines) | stat: -rw-r--r-- 1,898 bytes parent folder | download | duplicates (2)
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
57
58
59
60
61
62
63
64
65
name: Publish Docker images

on:
  push:
    branches:
      - 'master'
    tags:
      - 'v*'
  pull_request:
    branches:
      - 'master'

env:
  REGISTRY: quay.io
  ORGANIZATION: casacore
  IMAGE: ${{ github.repository }}

jobs:
  build_images:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Determine build-args
        id: args
        run: |
          py_major=$(echo ${{ matrix.python-version }} | cut -d'.' -f1)
          py_minor=$(echo ${{ matrix.python-version }} | cut -d'.' -f2)
          echo "PYMAJOR=${py_major}" >> "$GITHUB_OUTPUT"
          echo "PYMINOR=${py_minor}" >> "$GITHUB_OUTPUT"

      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v5
        with:
          flavor:
            prefix=py${{ steps.args.outputs.PYMAJOR }}${{ steps.args.outputs.PYMINOR }}_
          images: ${{ env.REGISTRY }}/${{ env.IMAGE }}

      - name: Login to registry
        id: login
        uses: docker/login-action@v3
        if: github.event_name != 'pull_request'
        with:
          # Credentials for robot account "github" on Quay for organization "casacore"
          registry: ${{ env.REGISTRY }}
          username: ${{ secrets.QUAY_USERNAME }}
          password: ${{ secrets.QUAY_PASSWORD }}

      - name: Build and push docker image
        id: build-push
        uses: docker/build-push-action@v5
        with:
          build-args: |
            PYMAJOR=${{ steps.args.outputs.PYMAJOR }}
            PYMINOR=${{ steps.args.outputs.PYMINOR }}
          file: docker/py_wheel.docker
          push: ${{ github.event_name != 'pull_request' }}
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}