|
| 1 | +name: fluent-bit-release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [released] |
| 6 | + |
| 7 | +env: |
| 8 | + REGISTRY: ghcr.io |
| 9 | + IMAGE_NAME: "coollabsio/fluent-bit" |
| 10 | + |
| 11 | +jobs: |
| 12 | + amd64: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v3 |
| 17 | + - name: Set up QEMU |
| 18 | + uses: docker/setup-qemu-action@v2 |
| 19 | + - name: Set up Docker Buildx |
| 20 | + uses: docker/setup-buildx-action@v2 |
| 21 | + - name: Login to ghcr.io |
| 22 | + uses: docker/login-action@v2 |
| 23 | + with: |
| 24 | + registry: ${{ env.REGISTRY }} |
| 25 | + username: ${{ github.actor }} |
| 26 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 27 | + - name: Extract metadata (tags, labels) |
| 28 | + id: meta |
| 29 | + uses: docker/metadata-action@v4 |
| 30 | + with: |
| 31 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 32 | + tags: | |
| 33 | + type=semver,pattern={{version}} |
| 34 | + - name: Build and push |
| 35 | + uses: docker/build-push-action@v3 |
| 36 | + with: |
| 37 | + context: . |
| 38 | + platforms: linux/amd64 |
| 39 | + push: true |
| 40 | + tags: ${{ steps.meta.outputs.tags }} |
| 41 | + aarch64: |
| 42 | + runs-on: |
| 43 | + group: aarch-runners |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v3 |
| 47 | + - name: Set up QEMU |
| 48 | + uses: docker/setup-qemu-action@v1 |
| 49 | + - name: Set up Docker Buildx |
| 50 | + uses: docker/setup-buildx-action@v1 |
| 51 | + - name: Login to ghcr.io |
| 52 | + uses: docker/login-action@v2 |
| 53 | + with: |
| 54 | + registry: ${{ env.REGISTRY }} |
| 55 | + username: ${{ github.actor }} |
| 56 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Extract metadata (tags, labels) |
| 58 | + id: meta |
| 59 | + uses: docker/metadata-action@v4 |
| 60 | + with: |
| 61 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 62 | + tags: | |
| 63 | + type=semver,pattern={{version}}-aarch64 |
| 64 | + - name: Build and push |
| 65 | + uses: docker/build-push-action@v3 |
| 66 | + with: |
| 67 | + context: . |
| 68 | + platforms: linux/aarch64 |
| 69 | + push: true |
| 70 | + tags: ${{ steps.meta.outputs.tags }}-aarch64 |
| 71 | + merge-manifest: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + needs: [amd64, aarch64] |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@v3 |
| 77 | + - name: Set up QEMU |
| 78 | + uses: docker/setup-qemu-action@v2 |
| 79 | + - name: Set up Docker Buildx |
| 80 | + uses: docker/setup-buildx-action@v2 |
| 81 | + - name: Login to ghcr.io |
| 82 | + uses: docker/login-action@v2 |
| 83 | + with: |
| 84 | + registry: ${{ env.REGISTRY }} |
| 85 | + username: ${{ github.actor }} |
| 86 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 87 | + - name: Extract metadata (tags, labels) |
| 88 | + id: meta |
| 89 | + uses: docker/metadata-action@v4 |
| 90 | + with: |
| 91 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 92 | + tags: | |
| 93 | + type=semver,pattern={{version}} |
| 94 | + - name: Create & publish manifest |
| 95 | + run: | |
| 96 | + docker buildx imagetools create --append ${{ fromJSON(steps.meta.outputs.json).tags[0] }}-aarch64 --tag ${{ fromJSON(steps.meta.outputs.json).tags[0] }} |
| 97 | + docker buildx imagetools create --append ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-aarch64 --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
0 commit comments