From 9c969a26100186088a31087d907723dc36d108c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9COgnyan?= Date: Tue, 3 Dec 2024 12:49:01 +0200 Subject: [PATCH] chore: add github action to update remote docker images on a new tag push --- .github/workflows/docker-release.yml | 38 +++++++++++++++++++ .../contributing/releases/deployment.md | 13 ------- .../releases/release_checklist.md | 9 +++-- portal-spec-tests | 2 +- 4 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/docker-release.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 000000000..33a030dda --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,38 @@ +name: Update Docker Image Tag from "latest" to 'testnet' + +on: + workflow_dispatch: # Allows manual triggering of the workflow + push: + tags: + - v* + +jobs: + retag-and-push: + name: Retag and Push Docker Image + runs-on: ubuntu-latest + + steps: + # Step 1: Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + # Step 2: Pull the latest images + - name: Pull Docker images + run: | + docker pull portalnetwork/trin:latest + docker pull portalnetwork/trin:latest-bridge + + # Step 3: Retag the images + - name: Retag Docker images + run: | + docker image tag portalnetwork/trin:latest portalnetwork/trin:testnet + docker image tag portalnetwork/trin:latest-bridge portalnetwork/trin:bridge + + # Step 4: Push the new tags to Docker Hub + - name: Push new tags to Docker Hub + run: | + docker push portalnetwork/trin:testnet + docker push portalnetwork/trin:bridge diff --git a/book/src/developers/contributing/releases/deployment.md b/book/src/developers/contributing/releases/deployment.md index 402c8eede..1f759c163 100644 --- a/book/src/developers/contributing/releases/deployment.md +++ b/book/src/developers/contributing/releases/deployment.md @@ -38,19 +38,6 @@ - Announce in Discord #trin that you're about to run the deployment - Make sure to schedule plenty of time to react to deployment issues -### Update Docker images -Docker images are how Ansible moves the binaries to the nodes. Update the Docker tags with: -```shell -docker pull portalnetwork/trin:latest -docker pull portalnetwork/trin:latest-bridge -docker image tag portalnetwork/trin:latest portalnetwork/trin:testnet -docker image tag portalnetwork/trin:latest-bridge portalnetwork/trin:bridge -docker push portalnetwork/trin:testnet -docker push portalnetwork/trin:bridge -``` - -This step directs Ansible to use the current master version of trin. Read [about the tags](#what-do-the-docker-tags-mean) to understand more. - ### Run ansible - Check monitoring tools to understand network health, and compare against post-deployment, eg~ - [Glados](https://glados.ethdevops.io/) diff --git a/book/src/developers/contributing/releases/release_checklist.md b/book/src/developers/contributing/releases/release_checklist.md index 27e505321..16c58b8da 100644 --- a/book/src/developers/contributing/releases/release_checklist.md +++ b/book/src/developers/contributing/releases/release_checklist.md @@ -29,17 +29,18 @@ git pull --rebase upstream master ``` 2. Create a new git tag with the chosen version, for example: ```bash -git tag v0.1.0-alpha.15 +git tag v0.1.1 ``` 3. Push the tag to the upstream repository: ```bash -git push upstream v0.1.0-alpha.15 +git push upstream v0.1.1 ``` -4. Wait for the github actions release job to finish. It will create automatically a draft release with all precompiled binaries included. +4. Wait for the github actions release job to finish. It will create automatically a draft release with all precompiled binaries included +and will update the remote docker images for deployment. This should take 15-20 min to complete. 5. Find the draft release generated by the github bot in releases and edit the template by completing and deleting all checklists. Write a short summary if available. Add any clarifying information that's helpful about the release. -6. Scroll to the bottom, check the `Set as a pre-release` box and click `Publish release`. +6. Scroll to the bottom, and click `Publish release`. ### Build Instructions * [Linux](../build_instructions/linux.md) diff --git a/portal-spec-tests b/portal-spec-tests index 7e3e34ef1..eb0882356 160000 --- a/portal-spec-tests +++ b/portal-spec-tests @@ -1 +1 @@ -Subproject commit 7e3e34ef1e52695628fb0cbe857cc1bfd511e5f2 +Subproject commit eb08823561e46dcb26d025bbc7b5112668655e0b