| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- name: Build
- on:
- workflow_call:
- env:
- DOCKER_META_IMAGES: |
- darthsim/imgproxy
- DOCKER_META_TAGS: |
- type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
- type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/heads/test/') }}
- type=semver,pattern=v{{version}}
- type=semver,pattern=v{{major}}.{{minor}}
- type=semver,pattern=v{{major}}
- jobs:
- build:
- strategy:
- matrix:
- build:
- - arch: amd64
- dockerPlatform: linux/amd64
- image: linux-5.0
- - arch: arm64
- dockerPlatform: linux/arm64/v8
- image: arm-3.0
- runs-on:
- - codebuild-imgproxy-${{ github.run_id }}-${{ github.run_attempt }}
- - image:${{ matrix.build.image }}
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- - name: Docker meta
- id: meta
- uses: docker/metadata-action@v5
- with:
- images: ${{ env.DOCKER_META_IMAGES }}
- tags: ${{ env.DOCKER_META_TAGS }}
- flavor: |
- latest=false
- suffix=-${{ matrix.build.arch }}
- - name: Login to Docker Hub
- uses: docker/login-action@v3
- with:
- username: ${{ vars.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- - name: Build and push
- uses: docker/build-push-action@v6
- with:
- context: .
- file: ./docker/Dockerfile
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- platforms: ${{ matrix.build.dockerPlatform }}
- push: true
- push_manifests:
- needs: build
- runs-on: ubuntu-latest
- steps:
- - name: Docker meta
- id: meta
- uses: docker/metadata-action@v5
- with:
- images: ${{ env.DOCKER_META_IMAGES }}
- tags: ${{ env.DOCKER_META_TAGS }}
- flavor: |
- latest=false
- - name: Login to Docker Hub
- uses: docker/login-action@v3
- with:
- username: ${{ vars.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
- - name: Push manifests
- run: |
- for tag in ${{ join(fromJSON(steps.meta.outputs.json).tags, ' ') }}
- do
- docker buildx imagetools create -t $tag ${tag}-amd64 ${tag}-arm64
- done
|