-
Notifications
You must be signed in to change notification settings - Fork 105
39 lines (33 loc) · 1.09 KB
/
Update-testnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Validator Validation
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
update-validator:
runs-on: ubuntu-latest
needs: tag-image
steps:
- name: SSH into VM
uses: appleboy/[email protected]
env:
NEW_IMAGE: ${{ needs.tag-image.outputs.image_tag }}
with:
host: ${{ secrets.VARA_VALIDATOR_8 }}
username: ${{ secrets.SSH_VARA_USERNAME }}
key: ${{ secrets.VARA_SSH_PRIVATE_KEY }}
envs: NEW_IMAGE
script: |
sudo docker-compose -f /home/gear/docker-compose.yaml down
sudo sed -i 's|ghcr.io/gear-tech/node:.*|$NEW_IMAGE|' /home/gear/docker-compose.yaml
sudo docker-compose -f /home/gear/docker-compose.yaml up -d