Skip to content

Update production testnet #199

Update production testnet

Update production testnet #199

name: Update production testnet
on:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
tag-image:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.image-tag.outputs.tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Create image tag
id: image-tag
run: echo "tag=ghcr.io/gear-tech/node:0.1.0-`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_OUTPUT
docker:
runs-on: [kuberunner]
needs: tag-image
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Echo tag
run: echo ${{ needs.tag-image.outputs.image_tag }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/gear-tech/node:latest, ${{ needs.tag-image.outputs.image_tag }}
# deploy-one-validator:
# runs-on: ubuntu-latest
# needs: [docker, tag-image]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Send telegram notify before run playbook
# uses: appleboy/telegram-action@master
# with:
# to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# message: |
# Attention! Instances will be temporarily unavailable!
# Update second validator!
# ${{ github.actor }} run build with commit: "${{ github.event.commits[0].message }}"
# Build number: ${{ github.run_number }}
# - name: Run playbook
# uses: dawidd6/action-ansible-playbook@v2
# with:
# # Required, playbook filepath
# directory: ./ansible/
# playbook: main.yaml
# # Optional, SSH private key
# key: ${{secrets.SSH_PRIVATE_KEY}}
# # Optional, literal inventory file contents
# inventory: |
# [gearNodes:children]
# nodes
# [nodes]
# ${{secrets.GEAR_NODE_2}} name=testnet-gear02 validator=yes loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}
# deploy-all-validators:
# runs-on: ubuntu-latest
# environment: production
# needs: [docker, deploy-one-validator,tag-image]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Send telegram notify before run playbook
# uses: appleboy/telegram-action@master
# with:
# to: ${{ secrets.TELEGRAM_CHANNEL_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# message: |
# Attention! Instances will be temporarily unavailable!
# Update all testnet!
# ${{ github.actor }} run build with commit: "${{ github.event.commits[0].message }}"
# Build number: ${{ github.run_number }}
# - name: Run playbook
# uses: dawidd6/action-ansible-playbook@v2
# with:
# # Required, playbook filepath
# directory: ./ansible/
# playbook: main.yaml
# # Optional, SSH private key
# key: ${{secrets.SSH_PRIVATE_KEY}}
# # Optional, literal inventory file contents
# inventory: |
# [gearNodes:children]
# bootnode
# nodes
# [bootnode]
# ${{secrets.GEAR_NODE}} name=testnet-gear01 loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}
# [nodes]
# ${{secrets.GEAR_NODE_3}} name=testnet-rpc-node rpc=yes unsafe=yes loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}
# ${{secrets.GEAR_NODE_4}} name=testnet-gear03 validator=yes loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}
# ${{secrets.GEAR_NODE_5}} name=testnet-gear04 validator=yes loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}
# ${{secrets.ARCHIVE_RPC_NODE}} name=testnet-archive-rpc-node rpc=yes unsafe=no archive_node=yes loki=yes loki_url=${{secrets.LOKI_URL}} gear_image_tag=${{ needs.tag-image.outputs.image_tag }}