@@ -3,7 +3,7 @@ name: Continuous integration
3
3
on :
4
4
push :
5
5
branches :
6
- - master
6
+ - BC-274-second-node
7
7
8
8
concurrency : master
9
9
@@ -111,27 +111,37 @@ jobs:
111
111
if : ${{ env.CONTINUOUS_DEPLOYMENT_ENABLED == 'True' }}
112
112
run : |
113
113
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
115
116
chmod 600 ~/.ssh/github
116
117
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
119
127
User $DEPLOY_SSH_USER
120
128
IdentityFile ~/.ssh/github
121
129
LogLevel ERROR
122
130
StrictHostKeyChecking no
123
131
END
124
132
env :
125
133
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 }}
128
138
DEPLOY_SSH_USER : ${{ secrets.NODE_DEPLOY_SSH_USER }}
129
139
130
140
- name : Run deploy
131
141
# TODO(dmu) MEDIUM: Once/if github implements secrets on job level
132
142
# https://github.com/actions/runner/issues/520#issuecomment-877193387
133
143
if : ${{ env.CONTINUOUS_DEPLOYMENT_ENABLED == 'True' }}
134
144
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
136
146
env :
137
147
CONTINUOUS_DEPLOYMENT_ENABLED : ${{ secrets.NODE_CONTINUOUS_DEPLOYMENT_ENABLED }}
0 commit comments