From 702c6604203fce744d407ff0a6cc9dce9a440f65 Mon Sep 17 00:00:00 2001 From: Alexey Zhigaev Date: Fri, 5 Jul 2024 10:31:11 +0300 Subject: [PATCH] add Celestia app builds COSMOS-2460 --- .github/workflows/celestia-app.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/celestia-app.yml diff --git a/.github/workflows/celestia-app.yml b/.github/workflows/celestia-app.yml new file mode 100644 index 0000000..24e195d --- /dev/null +++ b/.github/workflows/celestia-app.yml @@ -0,0 +1,57 @@ +name: Build and Push Celestia app Docker Image + +on: + push: + tags: + - "celestia-app-v[0-9]+.[0-9]+.[0-9]+" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + INFRA_TOOLKIT: v0.1.6 + +jobs: + build-and-push-celestia-app: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.22' + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Heighliner binary + run: | + go build -o heighliner + + - name: Extract version from tag + id: extract_version + run: echo "VERSION=${GITHUB_REF#refs/tags/celestia-app-}" >> $GITHUB_ENV + + - name: Manually pull the base Docker image + run: | + echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + docker pull ghcr.io/p2p-org/cosmos-heighliner:infra-toolkit-${{ env.INFRA_TOOLKIT }} + + - name: Build and push Celestia app Docker image + run: | + ./heighliner build -c celestia-appd --git-ref ${{ env.VERSION }} + + - name: Tag and push Docker image + run: | + docker tag celestia-app:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:celestia-app-${{ env.VERSION }} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:celestia-app-${{ env.VERSION }}