Merge pull request #2281 from riemannulus/ci/remove-deprecate-build #282
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push docker image | |
on: | |
push: | |
branches: | |
- main | |
- rc-* | |
- development | |
- previewnet | |
- release/* | |
tags: | |
- "*" | |
workflow_dispatch: | |
inputs: | |
imageTag: | |
description: 'Custom docker image tag if needed' | |
default: '' | |
jobs: | |
build_and_push: | |
name: build_and_push (${{ matrix.docker.repo }}) | |
strategy: | |
matrix: | |
docker: | |
- repo: planetariumhq/lib9c-stateservice | |
dockerfile: Dockerfile | |
if: github.ref_type == 'branch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: login | |
run: | | |
docker login \ | |
--username '${{ secrets.DOCKER_USERNAME }}' \ | |
--password '${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}' | |
- name: setup-qemu | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static \ | |
--reset \ | |
-p yes | |
- name: build-and-push-amd64 | |
run: | | |
docker build . \ | |
-f ${{ matrix.docker.dockerfile }}.amd64 \ | |
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ | |
--build-arg COMMIT=git-${{ github.sha }} | |
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 | |
- name: build-and-push-arm64v8 | |
run: | | |
docker build . \ | |
-f ${{ matrix.docker.dockerfile }}.arm64v8 \ | |
-t ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 \ | |
--build-arg COMMIT=git-${{ github.sha }} | |
docker push ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 | |
- name: merge-manifest-and-push | |
run: | | |
docker manifest create ${{ matrix.docker.repo }}:git-${{ github.sha }} \ | |
--amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-amd64 \ | |
--amend ${{ matrix.docker.repo }}:git-${{ github.sha }}-arm64v8 | |
docker manifest push ${{ matrix.docker.repo }}:git-${{ github.sha }} |