|
23 | 23 | - main |
24 | 24 | jobs: |
25 | 25 | build-operator-image-multiarch: |
26 | | - strategy: |
27 | | - fail-fast: false |
28 | | - matrix: |
29 | | - runners: ['ubuntu-24.04', 'ubuntu-24.04-arm'] |
30 | | - runs-on: ${{matrix.runners}} |
| 26 | + runs-on: ubuntu-24.04 |
| 27 | + |
| 28 | + outputs: |
| 29 | + git-sha: ${{ steps.git-sha.outputs.sha }} |
| 30 | + |
31 | 31 | steps: |
32 | 32 | - name: Checkout source code |
33 | 33 | uses: actions/checkout@v4 |
34 | | - - name: Set arch environment variable |
35 | | - run: | |
36 | | - if [[ ${{matrix.runners}} == 'ubuntu-24.04' ]]; then |
37 | | - echo arch="amd64" >> $GITHUB_ENV |
38 | | - else |
39 | | - echo arch="arm64" >> $GITHUB_ENV |
40 | | - fi |
41 | | - - name: Set short_sha environment variable |
42 | | - run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV |
| 34 | + - name: Set up QEMU |
| 35 | + uses: docker/setup-qemu-action@v3 |
| 36 | + - name: Set up Docker Buildx |
| 37 | + uses: docker/setup-buildx-action@v3 |
| 38 | + - name: Set output for Git short SHA |
| 39 | + id: git-sha |
| 40 | + run: echo "sha=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT |
| 41 | + |
43 | 42 | - name: Login to quay.io |
44 | | - uses: docker/login-action@v2 |
| 43 | + uses: docker/login-action@v3 |
45 | 44 | with: |
46 | 45 | username: ${{ secrets.QUAY_USERNAME }} |
47 | 46 | password: ${{ secrets.QUAY_PASSWORD }} |
48 | 47 | registry: quay.io |
49 | | - - name: Build operator image |
50 | | - run: | |
51 | | - docker buildx build \ |
52 | | - --platform linux/${{env.arch}} \ |
53 | | - --progress=plain \ |
54 | | - --push \ |
55 | | - -t quay.io/eclipse/che-operator:${{env.arch}}-${{env.short_sha}} . |
56 | 48 |
|
57 | | - publish-operator-manifest: |
58 | | - name: publish operator image |
59 | | - runs-on: ubuntu-24.04 |
60 | | - needs: build-operator-image-multiarch |
61 | | - steps: |
62 | | - - name: Checkout source code |
63 | | - uses: actions/checkout@v4 |
64 | | - - name: Login to Quay.io |
65 | | - uses: docker/login-action@v2 |
| 49 | + - name: Build and push |
| 50 | + uses: docker/build-push-action@v6 |
66 | 51 | with: |
67 | | - registry: quay.io |
68 | | - username: ${{ secrets.QUAY_USERNAME }} |
69 | | - password: ${{ secrets.QUAY_PASSWORD }} |
70 | | - - name: Set short_sha environment variable |
71 | | - run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV |
72 | | - - name: publish |
73 | | - run: | |
74 | | - docker manifest create quay.io/eclipse/che-operator:next \ |
75 | | - --amend quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ |
76 | | - --amend quay.io/eclipse/che-operator:arm64-${{env.short_sha}} |
77 | | - docker manifest annotate quay.io/eclipse/che-operator:next \ |
78 | | - quay.io/eclipse/che-operator:amd64-${{env.short_sha}} \ |
79 | | - --os linux --arch amd64 |
80 | | - docker manifest annotate quay.io/eclipse/che-operator:next \ |
81 | | - quay.io/eclipse/che-operator:arm64-${{env.short_sha}} \ |
82 | | - --os linux --arch arm64 |
83 | | - docker manifest push quay.io/eclipse/che-operator:next |
| 52 | + context: . |
| 53 | + push: true |
| 54 | + platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x |
| 55 | + tags: | |
| 56 | + quay.io/eclipse/che-operator:next |
| 57 | + quay.io/eclipse/che-operator:sha-${{ steps.git-sha.outputs.sha }} |
| 58 | + file: ./Dockerfile |
84 | 59 |
|
85 | 60 | build-catalog: |
86 | 61 | runs-on: ubuntu-24.04 |
87 | | - needs: publish-operator-manifest |
| 62 | + needs: build-operator-image-multiarch |
88 | 63 | steps: |
89 | 64 | - name: Checkout source code |
90 | 65 | uses: actions/checkout@v4 |
|
95 | 70 | - name: Install yq |
96 | 71 | run: sudo pip install yq |
97 | 72 | - name: Login to quay.io |
98 | | - uses: docker/login-action@v2 |
| 73 | + uses: docker/login-action@v3 |
99 | 74 | with: |
100 | 75 | username: ${{ secrets.QUAY_USERNAME }} |
101 | 76 | password: ${{ secrets.QUAY_PASSWORD }} |
|
121 | 96 | - name: Install yq |
122 | 97 | run: sudo pip install yq |
123 | 98 | - name: Login to quay.io |
124 | | - uses: docker/login-action@v2 |
| 99 | + uses: docker/login-action@v3 |
125 | 100 | with: |
126 | 101 | username: ${{ secrets.QUAY_USERNAME }} |
127 | 102 | password: ${{ secrets.QUAY_PASSWORD }} |
|
0 commit comments