Skip to content

Commit 948f139

Browse files
committed
BC-274 Configure second node.
1 parent 44c467c commit 948f139

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/master.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Continuous integration
33
on:
44
push:
55
branches:
6-
- master
6+
- BC-274-second-node
77

88
concurrency: master
99

@@ -111,27 +111,37 @@ jobs:
111111
if: ${{ env.CONTINUOUS_DEPLOYMENT_ENABLED == 'True' }}
112112
run: |
113113
mkdir -p ~/.ssh/
114-
echo "$DEPLOY_SSH_KEY" > ~/.ssh/github
114+
echo "$DEPLOY_SSH_KEY_1" > ~/.ssh/github
115+
echo "$DEPLOY_SSH_KEY_2" >> ~/.ssh/github
115116
chmod 600 ~/.ssh/github
116117
cat >>~/.ssh/config <<END
117-
Host target
118-
HostName $DEPLOY_SSH_HOST
118+
Host target_1
119+
HostName $DEPLOY_SSH_HOST_1
120+
User $DEPLOY_SSH_USER
121+
IdentityFile ~/.ssh/github
122+
LogLevel ERROR
123+
StrictHostKeyChecking no
124+
END
125+
Host target_2
126+
HostName $DEPLOY_SSH_HOST_2
119127
User $DEPLOY_SSH_USER
120128
IdentityFile ~/.ssh/github
121129
LogLevel ERROR
122130
StrictHostKeyChecking no
123131
END
124132
env:
125133
CONTINUOUS_DEPLOYMENT_ENABLED: ${{ secrets.NODE_CONTINUOUS_DEPLOYMENT_ENABLED }}
126-
DEPLOY_SSH_KEY: ${{ secrets.NODE_DEPLOY_SSH_KEY }}
127-
DEPLOY_SSH_HOST: ${{ secrets.NODE_DEPLOY_SSH_HOST }}
134+
DEPLOY_SSH_KEY_1: ${{ secrets.NODE_DEPLOY_SSH_KEY_1 }}
135+
DEPLOY_SSH_KEY_2: ${{ secrets.NODE_DEPLOY_SSH_KEY_2 }}
136+
DEPLOY_SSH_HOST_1: ${{ secrets.NODE_DEPLOY_SSH_HOST_1 }}
137+
DEPLOY_SSH_HOST_2: ${{ secrets.NODE_DEPLOY_SSH_HOST_2 }}
128138
DEPLOY_SSH_USER: ${{ secrets.NODE_DEPLOY_SSH_USER }}
129139

130140
- name: Run deploy
131141
# TODO(dmu) MEDIUM: Once/if github implements secrets on job level
132142
# https://github.com/actions/runner/issues/520#issuecomment-877193387
133143
if: ${{ env.CONTINUOUS_DEPLOYMENT_ENABLED == 'True' }}
134144
run: |
135-
ssh target "docker system prune --all --volumes --force && wget https://raw.githubusercontent.com/thenewboston-developers/Node/master/scripts/deploy.sh -O /tmp/deploy-node.sh && chmod a+x /tmp/deploy-node.sh && /tmp/deploy-node.sh ${{ github.actor }} ${{ secrets.GITHUB_TOKEN }} ${{ secrets.NODE_RUN_GENESIS }} && rm -f /tmp/deploy-node.sh"
145+
for variables in "target_1 ${{ secrets.NODE_RUN_GENESIS }}" "target_2 False"; do vars=($variables) && target=${vars[0]} && node_run_genesis=${vars[1]} && ssh $target "docker system prune --all --volumes --force && wget https://raw.githubusercontent.com/thenewboston-developers/Node/master/scripts/deploy.sh -O /tmp/deploy-node.sh && chmod a+x /tmp/deploy-node.sh && /tmp/deploy-node.sh ${{ github.actor }} ${{ secrets.GITHUB_TOKEN }} $node_run_genesis && rm -f /tmp/deploy-node.sh"; done
136146
env:
137147
CONTINUOUS_DEPLOYMENT_ENABLED: ${{ secrets.NODE_CONTINUOUS_DEPLOYMENT_ENABLED }}

0 commit comments

Comments
 (0)