|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + tag: |
| 7 | + description: "Tag to release (e.g. v1.2.3)" |
| 8 | + required: true |
| 9 | + |
| 10 | +env: |
| 11 | + GO_VERSION: "1.25" |
| 12 | + REGISTRY: ghcr.io |
| 13 | + IMAGE: ghcr.io/syscode-labs/oci-pivot-controller |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-push: |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - arch: amd64 |
| 21 | + runner: ubuntu-24.04 |
| 22 | + - arch: arm64 |
| 23 | + runner: ubuntu-24.04-arm |
| 24 | + runs-on: ${{ matrix.runner }} |
| 25 | + permissions: |
| 26 | + contents: read |
| 27 | + packages: write |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - uses: docker/setup-buildx-action@v3 |
| 32 | + |
| 33 | + - uses: docker/login-action@v4 |
| 34 | + with: |
| 35 | + registry: ${{ env.REGISTRY }} |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + - uses: docker/build-push-action@v6 |
| 40 | + with: |
| 41 | + context: . |
| 42 | + platforms: linux/${{ matrix.arch }} |
| 43 | + push: true |
| 44 | + tags: | |
| 45 | + ${{ env.IMAGE }}:${{ inputs.tag }}-${{ matrix.arch }} |
| 46 | + ${{ env.IMAGE }}:latest-${{ matrix.arch }} |
| 47 | +
|
| 48 | + merge-manifests: |
| 49 | + needs: build-push |
| 50 | + runs-on: ubuntu-24.04 |
| 51 | + permissions: |
| 52 | + packages: write |
| 53 | + steps: |
| 54 | + - uses: docker/login-action@v4 |
| 55 | + with: |
| 56 | + registry: ${{ env.REGISTRY }} |
| 57 | + username: ${{ github.actor }} |
| 58 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + |
| 60 | + - name: Create multi-arch manifests |
| 61 | + run: | |
| 62 | + docker buildx imagetools create \ |
| 63 | + -t ${{ env.IMAGE }}:${{ inputs.tag }} \ |
| 64 | + ${{ env.IMAGE }}:${{ inputs.tag }}-amd64 \ |
| 65 | + ${{ env.IMAGE }}:${{ inputs.tag }}-arm64 |
| 66 | + docker buildx imagetools create \ |
| 67 | + -t ${{ env.IMAGE }}:latest \ |
| 68 | + ${{ env.IMAGE }}:latest-amd64 \ |
| 69 | + ${{ env.IMAGE }}:latest-arm64 |
0 commit comments