Skip to content

Commit

Permalink
chore: add github action to update remote docker images on a new tag …
Browse files Browse the repository at this point in the history
…push
  • Loading branch information
ogenev committed Dec 5, 2024
1 parent 3db8488 commit 9c969a2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 18 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 0 additions & 13 deletions book/src/developers/contributing/releases/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9c969a2

Please sign in to comment.