From d908903f2e57face6fea5353f167b5b80238d6de Mon Sep 17 00:00:00 2001 From: Serge Radinovich <47865535+sergerad@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:46:53 +1300 Subject: [PATCH] Replace tag workflow with testnet image workflow (#22) --- .github/workflows/tag.yaml | 22 ---------------------- .github/workflows/testnet.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/tag.yaml create mode 100644 .github/workflows/testnet.yaml diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml deleted file mode 100644 index f34469b23..000000000 --- a/.github/workflows/tag.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Tag - -on: - push: - tags: - - "**" - -jobs: - push: - name: Push Docker - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set Release Tag - run: echo "TAG=$(echo ${GITHUB_REF} | sed 's/refs\/tags\///')" >> $GITHUB_ENV - - - uses: ./.github/actions/push - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - tags: "ghcr.io/${{ github.repository }}/immutable-geth:${{ env.TAG }}" diff --git a/.github/workflows/testnet.yaml b/.github/workflows/testnet.yaml new file mode 100644 index 000000000..f0735cafa --- /dev/null +++ b/.github/workflows/testnet.yaml @@ -0,0 +1,33 @@ +name: Push Testnet Docker Image + +on: + workflow_dispatch: + inputs: + dev: + description: "Develop tag to push as testnet (e.g. develop-1736464855-git.6a0aa89)" + required: true + version: + description: "Testnet version to use in the new image tag (e.g. v1.0.0-beta.13)" + required: true + +jobs: + tag_and_push_testnet_image: + name: Tag and Push Testnet Image + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Promote Develop image to Testnet + shell: bash + run: | + dev_tag="${{ inputs.dev }}" + dev_image="ghcr.io/${{ github.repository }}/immutable-geth:$dev_tag" + testnet_image="ghcr.io/${{ github.repository }}/immutable-geth:testnet-${{ inputs.version }}" + + docker pull "$dev_image" + docker tag "$dev_image" $testnet_image" + docker push "$testnet_image"