|
1 |
| - name: Build Development Ikarus Docker Images |
| 1 | +name: Build and Publish Docker Images |
2 | 2 |
|
3 |
| - on: |
4 |
| - workflow_run: |
5 |
| - workflows: ["Build Development Debian and DUNE base Images"] |
6 |
| - branches: [main] |
7 |
| - types: |
8 |
| - - completed |
9 |
| - workflow_dispatch: |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'main' ] |
| 6 | + paths: |
| 7 | + - 'Debian12/**' |
| 8 | + - 'DuneBase/**' |
| 9 | + - 'DevelopContainer/**' |
| 10 | + workflow_dispatch: |
10 | 11 |
|
11 |
| - jobs: |
12 |
| - build-docker-debian: |
13 |
| - runs-on: ubuntu-latest |
| 12 | +# Reusable step definitions |
| 13 | +x-steps: |
| 14 | + checkout: &checkout |
| 15 | + - uses: actions/checkout@v4 |
14 | 16 |
|
15 |
| - steps: |
16 |
| - - uses: actions/checkout@v2 |
17 |
| - - name: Build the Development Docker image |
18 |
| - working-directory: ./DevelopContainer |
19 |
| - run: | |
20 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-dev-gcc-debian12:latest --build-arg compiler="gcc-debian12" --build-arg ccompiler="gcc-12" --build-arg cppcompiler="g++-12" |
21 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-dev-clang-debian12:latest --build-arg compiler="clang-debian12" --build-arg ccompiler="clang-16" --build-arg cppcompiler="clang++-16" |
22 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-dev-gcc-debian13:latest --build-arg compiler="gcc-debian13" --build-arg ccompiler="gcc-14" --build-arg cppcompiler="g++-14" |
23 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-dev-clang-debian13:latest --build-arg compiler="clang-debian13" --build-arg ccompiler="clang-17" --build-arg cppcompiler="clang++-17" |
24 |
| - docker tag ikarusproject/ikarus-dev-gcc-debian12:latest ikarusproject/ikarus-dev:latest # set the latest tag to the gcc image |
25 |
| - docker tag ikarusproject/ikarus-dev-gcc-debian12:latest ikarusproject/ikarus-dev-gcc:latest |
26 |
| - docker tag ikarusproject/ikarus-dev-clang-debian12:latest ikarusproject/ikarus-dev-clang:latest |
27 |
| - - name: Docker Login |
28 |
| - uses: azure/docker-login@v1 |
29 |
| - with: |
30 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
31 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
32 |
| - - name: Publish the Docker image |
33 |
| - run: | |
34 |
| - docker push ikarusproject/ikarus-dev-gcc:latest |
35 |
| - docker push ikarusproject/ikarus-dev-clang:latest |
36 |
| - docker push ikarusproject/ikarus-dev:latest |
37 |
| - docker push ikarusproject/ikarus-dev-gcc-debian13:latest |
38 |
| - docker push ikarusproject/ikarus-dev-clang-debian13:latest |
39 |
| - docker push ikarusproject/ikarus-dev-gcc-debian12:latest |
40 |
| - docker push ikarusproject/ikarus-dev-clang-debian12:latest |
41 |
| - |
42 |
| - - name: Build the Installed Docker image |
43 |
| - working-directory: ./InstalledContainer |
44 |
| - run: | |
45 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-gcc-debian12:latest --build-arg compiler="gcc-debian12" --build-arg ccompiler="gcc-12" --build-arg cppcompiler="g++-12" |
46 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-clang-debian12:latest --build-arg compiler="clang-debian12" --build-arg ccompiler="clang-16" --build-arg cppcompiler="clang++-16" |
47 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-gcc-debian13:latest --build-arg compiler="gcc-debian13" --build-arg ccompiler="gcc-14" --build-arg cppcompiler="g++-14" |
48 |
| - docker build . --file Dockerfile --tag ikarusproject/ikarus-clang-debian13:latest --build-arg compiler="clang-debian13" --build-arg ccompiler="clang-17" --build-arg cppcompiler="clang++-17" |
49 |
| - docker tag ikarusproject/ikarus-gcc-debian12:latest ikarusproject/ikarus:latest # set the latest tag to the gcc image |
50 |
| - docker tag ikarusproject/ikarus-gcc-debian12:latest ikarusproject/ikarus-gcc:latest |
51 |
| - docker tag ikarusproject/ikarus-clang-debian12:latest ikarusproject/ikarus-clang:latest |
52 |
| - - name: Docker Login |
53 |
| - uses: azure/docker-login@v1 |
54 |
| - with: |
55 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
56 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
57 |
| - - name: Publish the Docker image |
58 |
| - run: | |
59 |
| - docker push ikarusproject/ikarus-gcc:latest |
60 |
| - docker push ikarusproject/ikarus-clang:latest |
61 |
| - docker push ikarusproject/ikarus-gcc-debian12:latest |
62 |
| - docker push ikarusproject/ikarus-clang-debian12:latest |
63 |
| - docker push ikarusproject/ikarus-gcc-debian13:latest |
64 |
| - docker push ikarusproject/ikarus-clang-debian13:latest |
65 |
| - docker push ikarusproject/ikarus:latest |
| 17 | + set-compiler: &set-compiler |
| 18 | + - name: Set compiler versions |
| 19 | + id: vars |
| 20 | + run: | |
| 21 | + case "${{ matrix.compiler }}:${{ matrix.debian_version }}" in |
| 22 | + gcc:12) |
| 23 | + echo "C_COMPILER=gcc-12" >> $GITHUB_ENV |
| 24 | + echo "CPP_COMPILER=g++-12" >> $GITHUB_ENV ;; |
| 25 | + clang:12) |
| 26 | + echo "C_COMPILER=clang-16" >> $GITHUB_ENV |
| 27 | + echo "CPP_COMPILER=clang++-16" >> $GITHUB_ENV ;; |
| 28 | + gcc:13) |
| 29 | + echo "C_COMPILER=gcc-14" >> $GITHUB_ENV |
| 30 | + echo "CPP_COMPILER=g++-14" >> $GITHUB_ENV ;; |
| 31 | + clang:13) |
| 32 | + echo "C_COMPILER=clang-17" >> $GITHUB_ENV |
| 33 | + echo "CPP_COMPILER=clang++-17" >> $GITHUB_ENV ;; |
| 34 | + esac |
66 | 35 |
|
67 |
| - # - name: Build the GrassHopperServer images |
68 |
| - # working-directory: ./GrassHopperServer |
69 |
| - # run: docker build . --file Dockerfile --tag ikarusproject/ikarus-grasshopper:latest |
70 |
| - # - name: Docker Login |
71 |
| - # uses: azure/docker-login@v1 |
72 |
| - # with: |
73 |
| - # username: ${{ secrets.DOCKER_USERNAME }} |
74 |
| - # password: ${{ secrets.DOCKER_PASSWORD }} |
75 |
| - # - name: Publish the Docker image |
76 |
| - # run: docker push ikarusproject/ikarus-grasshopper:latest |
| 36 | + docker-login: &docker-login |
| 37 | + - name: Docker Login |
| 38 | + uses: azure/docker-login@v1 |
| 39 | + with: |
| 40 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 41 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 42 | + |
| 43 | +jobs: |
| 44 | + build-debian: |
| 45 | + name: Build Debian Base Images |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + fail-fast: false |
| 49 | + matrix: |
| 50 | + debian_version: [12, 13] |
| 51 | + steps: |
| 52 | + <<: *checkout |
| 53 | + - name: Build Debian base image |
| 54 | + working-directory: ./Debian12 |
| 55 | + run: | |
| 56 | + tag="ikarusproject/debian${{ matrix.debian_version }}:latest" |
| 57 | + debian_codename=$([[ "${{ matrix.debian_version }}" == "12" ]] && echo bookworm || echo trixie) |
| 58 | + docker build . --file Dockerfile --tag $tag --build-arg debianversion="$debian_codename" |
| 59 | + <<: *docker-login |
| 60 | + - name: Push Debian image |
| 61 | + run: | |
| 62 | + docker push ikarusproject/debian${{ matrix.debian_version }}:latest |
| 63 | +
|
| 64 | + build-dunebase: |
| 65 | + name: Build DuneBase Images |
| 66 | + runs-on: ubuntu-latest |
| 67 | + needs: build-debian |
| 68 | + strategy: |
| 69 | + fail-fast: false |
| 70 | + matrix: |
| 71 | + include: |
| 72 | + - debian_version: 12 |
| 73 | + compiler: gcc |
| 74 | + - debian_version: 12 |
| 75 | + compiler: clang |
| 76 | + - debian_version: 13 |
| 77 | + compiler: gcc |
| 78 | + - debian_version: 13 |
| 79 | + compiler: clang |
| 80 | + steps: |
| 81 | + <<: *checkout |
| 82 | + <<: *set-compiler |
| 83 | + - name: Build DuneBase image |
| 84 | + working-directory: ./DuneBase |
| 85 | + run: | |
| 86 | + img="ikarusproject/dunebase-${{ matrix.compiler }}-debian${{ matrix.debian_version }}:latest" |
| 87 | + docker build . --file Dockerfile --tag $img \ |
| 88 | + --build-arg debianversion="${{ matrix.debian_version }}" \ |
| 89 | + --build-arg ccompiler="${{ env.C_COMPILER }}" \ |
| 90 | + --build-arg cppcompiler="${{ env.CPP_COMPILER }}" |
| 91 | + <<: *docker-login |
| 92 | + - name: Push DuneBase images |
| 93 | + run: | |
| 94 | + base="ikarusproject/dunebase-${{ matrix.compiler }}-debian${{ matrix.debian_version }}:latest" |
| 95 | + docker push $base |
| 96 | + if [[ "${{ matrix.debian_version }}" == "12" ]]; then |
| 97 | + shorthand="ikarusproject/dunebase-${{ matrix.compiler }}:latest" |
| 98 | + docker tag $base $shorthand |
| 99 | + docker push $shorthand |
| 100 | + fi |
| 101 | +
|
| 102 | + build-dev: |
| 103 | + name: Build Development Images |
| 104 | + runs-on: ubuntu-latest |
| 105 | + needs: build-dunebase |
| 106 | + strategy: |
| 107 | + fail-fast: false |
| 108 | + matrix: |
| 109 | + include: |
| 110 | + - debian_version: 12 |
| 111 | + compiler: gcc |
| 112 | + - debian_version: 12 |
| 113 | + compiler: clang |
| 114 | + - debian_version: 13 |
| 115 | + compiler: gcc |
| 116 | + - debian_version: 13 |
| 117 | + compiler: clang |
| 118 | + steps: |
| 119 | + <<: *checkout |
| 120 | + <<: *set-compiler |
| 121 | + - name: Build Development Docker image |
| 122 | + working-directory: ./DevelopContainer |
| 123 | + run: | |
| 124 | + img="ikarusproject/ikarus-dev-${{ matrix.compiler }}-debian${{ matrix.debian_version }}:latest" |
| 125 | + docker build . --file Dockerfile --tag $img \ |
| 126 | + --build-arg compiler="${{ matrix.compiler }}-debian${{ matrix.debian_version }}" \ |
| 127 | + --build-arg ccompiler="${{ env.C_COMPILER }}" \ |
| 128 | + --build-arg cppcompiler="${{ env.CPP_COMPILER }}" |
| 129 | + <<: *docker-login |
| 130 | + - name: Push Development images |
| 131 | + run: | |
| 132 | + base="ikarusproject/ikarus-dev-${{ matrix.compiler }}-debian${{ matrix.debian_version }}:latest" |
| 133 | + docker push $base |
| 134 | + if [[ "${{ matrix.debian_version }}" == "12" ]]; then |
| 135 | + if [[ "${{ matrix.compiler }}" == "gcc" ]]; then |
| 136 | + docker tag $base ikarusproject/ikarus-dev:latest |
| 137 | + docker push ikarusproject/ikarus-dev:latest |
| 138 | + fi |
| 139 | + shorthand="ikarusproject/ikarus-dev-${{ matrix.compiler }}:latest" |
| 140 | + docker tag $base $shorthand |
| 141 | + docker push $shorthand |
| 142 | + fi |
0 commit comments