From dbbb48d14e575610fce3dab57eec6c393c177395 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 23 May 2023 11:55:24 +0200 Subject: [PATCH] chore: adding workflow for docker build and push to main (#3597) * adding workflow for docker build and push to main * updating workflow name and adding path filter * adding workflow dispatch and hardcode ibc-go version to main --- .github/workflows/docker.yml | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000000..ea704c274f4 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,44 @@ +name: Docker Build & Push Simapp (main) +# Build & Push builds the simapp docker image on every push to main and +# and pushes the image to https://ghcr.io/cosmos/ibc-go-simd +on: + workflow_dispatch: + push: + branches: + - main + paths: + - '.github/workflows/docker.yml' + - '**.go' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ibc-go-simd + +jobs: + docker-build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e + with: + images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + build-args: | + IBC_GO_VERSION=main