From 2a4a5c34bbf0688c611314da78bc934fb1910656 Mon Sep 17 00:00:00 2001 From: minniux Date: Wed, 9 Oct 2024 15:22:26 +0400 Subject: [PATCH] Add terra-classic image COSMOS-2330 --- .github/workflows/terra-classic.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/terra-classic.yml diff --git a/.github/workflows/terra-classic.yml b/.github/workflows/terra-classic.yml new file mode 100644 index 00000000..9d1e43da --- /dev/null +++ b/.github/workflows/terra-classic.yml @@ -0,0 +1,57 @@ +name: Build and Push terra-classic Docker Image + +on: + push: + tags: + - "terra-classic-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-terra-classic: + 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.21' + + - 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/terra-classic-}" >> $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 terra-classic Docker image + run: | + ./heighliner build -c terra-classic --git-ref ${{ env.VERSION }} + + - name: Tag and push Docker image + run: | + docker tag terra-classic:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:terra-classic-${{ env.VERSION }} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:terra-classic-${{ env.VERSION }}