update wormchain repo #6
Workflow file for this run
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: Build and Push wormchain Docker Image | |
on: | |
push: | |
tags: | |
- "wormchain-v[0-9]+.[0-9]+.[0-9]+*" | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
INFRA_TOOLKIT: v0.1.6 | |
REPO: wormhole-wormchain-dos-fix | |
jobs: | |
build-and-push-wormchain: | |
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/wormchain-}" >> $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: Set environment variables | |
run: | | |
echo "GH_USER=${{ secrets.GH_USER }}" >> $GITHUB_ENV | |
echo "GH_PAT=${{ secrets.GH_PAT }}" >> $GITHUB_ENV | |
- name: Build and push wormchain Docker image | |
run: | | |
./heighliner build -c wormchain --repo ${{ env.REPO }} --clone-key ${{ secrets.CLONE_KEY }} --git-ref v2.24.2-wormchaind-sec-patch | |
env: | |
GH_USER: ${{ secrets.GH_USER }} | |
GH_PAT: ${{ secrets.GH_PAT }} | |
- name: Tag and push Docker image | |
run: | | |
docker tag wormchain:${{ env.VERSION }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:wormchain-${{ env.VERSION }} | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:wormchain-${{ env.VERSION }} |