diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 6f87bc23..ca2c2a6e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,57 +1,32 @@ -name: Docker Image CI +name: Docker + +# Shared EthDevOps workflow: pushes docker.ethquokkaops.io/ethquokkaops/ethdevops/claper. +# Tags: branch ref, latest (main), semver from v* tags. Multi-arch; ERL_FLAGS works +# around a qemu segfault in the Erlang builder (see erlang/otp#6340). on: + workflow_dispatch: push: - branches: [ "main", "dev" ] - tags: ['v*'] + branches: ["main", "dev"] + tags: ["v*"] + pull_request: + branches: ["main"] jobs: - - build: - - runs-on: ubuntu-latest - - env: - ImageOS: ubuntu20 - - steps: - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/ethdevops/claper - tags: | - type=ref,event=branch - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - - - uses: actions/checkout@v3 - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - with: - buildkitd-flags: --debug - driver-opts: image=moby/buildkit:v0.9.1 - - name: Log in to registry - # This is where you will update the PAT to GITHUB_TOKEN - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - - name: Build and push Docker image - # You may pin to the exact commit or the version. - # uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - BUILD_METADATA=${{ steps.meta.outputs.json }} - ERL_FLAGS=+JPperf true \ No newline at end of file + call-docker-build: + permissions: + contents: read + packages: write + id-token: write + uses: EthDevOps/workflows/.github/workflows/basic-docker-build-openbao.yaml@main + with: + bao_role: ethquokkaops-claper-ci + bao_secret_path: secret/ethquokkaops/data/docker-registry/production/credentials/ethquokkaops/robot-claper + platforms: linux/amd64,linux/arm64 + build_args: 'ERL_FLAGS=+JPperf true' + tags: | + type=ref,event=branch + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}}