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..0bf434b17 --- /dev/null +++ b/.github/workflows/testnet.yaml @@ -0,0 +1,31 @@ +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 + +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_tag="$(echo "$dev_tag" | sed "s/develop/testnet/g")" + testnet_image="ghcr.io/${{ github.repository }}/immutable-geth:$testnet_tag" + + docker pull "$dev_image" + docker tag "$dev_image" $testnet_image" + docker push "$testnet_image"