From c55621b6fa8abb728a5abe9cbb23dd89d95fcfbf Mon Sep 17 00:00:00 2001 From: ron Date: Tue, 20 Aug 2024 20:17:31 +0800 Subject: [PATCH] Release docker image --- .github/workflows/release-relayer.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-relayer.yml b/.github/workflows/release-relayer.yml index 7ea4a56521..2e5910de4c 100644 --- a/.github/workflows/release-relayer.yml +++ b/.github/workflows/release-relayer.yml @@ -7,6 +7,10 @@ on: - release-v1.0.0 workflow_dispatch: +env: + REGISTRY: ghcr.io + IMAGE_NAME: snowfork/snowbridge-relay + jobs: release-relayer: runs-on: snowbridge-runner @@ -19,12 +23,12 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v2 with: - node-version: '14' + node-version: "14" - name: Setup go uses: actions/checkout@v4 with: - go-version: '^1.21.0' + go-version: "^1.21.0" - name: Install Go tools run: > @@ -68,7 +72,7 @@ jobs: # Get the most recent tag in the format relayer-- current_version=$(git tag --list "relayer-${{ steps.branch_name.outputs.branch }}-*" --sort=-v:refname | head -n 1 | sed -E 's/relayer-${{ steps.branch_name.outputs.branch }}-//') echo "Current version: $current_version" - + # If there is no current version, set it to 1.0.0 if [ -z "$current_version" ]; then new_version="1.0.0" @@ -117,3 +121,17 @@ jobs: asset_path: ./relayer/build/snowbridge-relay asset_name: snowbridge-relay asset_content_type: application/octet-stream + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: ./relayer + push: true + tags: ${{ steps.create_tag.outputs.tag }}