|
1 | 1 | name: build-tasks
|
| 2 | + |
2 | 3 | on:
|
3 | 4 | # this is meant to be run on an approved PR branch for convenience
|
4 | 5 | workflow_dispatch:
|
| 6 | + |
| 7 | +# We derive a unique ID here to make sure that we don't get into a situation |
| 8 | +# where different runners pick different tags (eg: for builds near midnight, or |
| 9 | +# in different time zones). The manifest job picks the final name. |
| 10 | +env: |
| 11 | + tag: quay.io/cockpit/tasks |
| 12 | + tmptag: quay.io/cockpit/tasks-tmp:${{ github.run_id }}.${{ github.run_attempt }} |
| 13 | + |
5 | 14 | jobs:
|
6 | 15 | build:
|
7 |
| - runs-on: ubuntu-22.04 |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + build: |
| 19 | + - label: amd64 |
| 20 | + runner: buildjet-2vcpu-ubuntu-2204 |
| 21 | + - label: arm64 |
| 22 | + runner: buildjet-2vcpu-ubuntu-2204-arm |
| 23 | + |
| 24 | + runs-on: ${{ matrix.build.runner }} |
8 | 25 | environment: quay.io
|
9 |
| - timeout-minutes: 30 |
| 26 | + timeout-minutes: 10 |
| 27 | + |
10 | 28 | steps:
|
11 |
| - - name: Clone repository |
| 29 | + # NB: no podman on buildjet arm runners |
| 30 | + - |
| 31 | + name: Log in to container registry |
| 32 | + uses: docker/login-action@v3 |
| 33 | + with: |
| 34 | + registry: quay.io |
| 35 | + username: ${{ secrets.QUAY_BOTUSER }} |
| 36 | + password: ${{ secrets.QUAY_TOKEN }} |
| 37 | + - |
| 38 | + name: Checkout |
12 | 39 | uses: actions/checkout@v4
|
| 40 | + - |
| 41 | + name: Build and push |
| 42 | + uses: docker/build-push-action@v5 |
| 43 | + with: |
| 44 | + push: true |
| 45 | + tags: ${{ env.tmptag }}-${{ matrix.build.label }} |
| 46 | + context: tasks/container |
| 47 | + file: tasks/container/Containerfile |
13 | 48 |
|
14 |
| - - name: Log into container registry |
15 |
| - run: podman login -u ${{ secrets.QUAY_BOTUSER }} -p ${{ secrets.QUAY_TOKEN }} quay.io |
| 49 | + manifest: |
| 50 | + needs: build |
16 | 51 |
|
17 |
| - - name: Build tasks container |
18 |
| - run: make tasks-container |
| 52 | + runs-on: buildjet-2vcpu-ubuntu-2204 |
| 53 | + environment: quay.io |
| 54 | + timeout-minutes: 5 |
19 | 55 |
|
20 |
| - - name: Push container to registry |
21 |
| - run: make tasks-push |
| 56 | + steps: |
| 57 | + - |
| 58 | + name: Login in to container registry |
| 59 | + run: podman login -u ${{ secrets.QUAY_BOTUSER }} -p ${{ secrets.QUAY_TOKEN }} quay.io |
| 60 | + - |
| 61 | + name: Create manifest |
| 62 | + run: podman manifest create tasks '${{ env.tmptag }}'-{amd,arm}64 |
| 63 | + - |
| 64 | + name: Push with versioned tag |
| 65 | + run: podman manifest push tasks "${{ env.tag }}:$(date --iso-8601)" |
| 66 | + - |
| 67 | + name: Push :latest tag |
| 68 | + run: podman manifest push tasks "${{ env.tag }}:latest" |
0 commit comments