File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -157,20 +157,16 @@ jobs:
157157 echo "${{ secrets.SSH_PRIVATE_KEY }}" > ssh_key.pem
158158 chmod 600 ssh_key.pem
159159
160- # Export variables for use in SSH command
161- export REGISTRY_VAL=${REGISTRY}
162- export USERNAME_VAL=${OCI_USERNAME}
163- export TOKEN_VAL=${OCI_AUTH_TOKEN}
160+ # Using SSH with heredoc for commands
161+ ssh -o StrictHostKeyChecking=no -i ssh_key.pem opc@${ORACLE_VM_IP} << 'ENDSSH'
162+ cd ~/music-analytics/vm-deploy || exit 1
163+ docker login ${{ secrets.OCI_REGISTRY }} -u ${{ secrets.OCI_USERNAME }} -p ${{ secrets.OCI_AUTH_TOKEN }} || exit 1
164+ docker-compose pull || exit 1
165+ docker-compose up -d || exit 1
166+ docker logout ${{ secrets.OCI_REGISTRY }}
167+ echo "Deployment completed successfully"
168+ ENDSSH
164169
165- # Use EOF instead of 'EOF' to allow variable expansion
166- ssh -o StrictHostKeyChecking=no -i ssh_key.pem opc@${ORACLE_VM_IP} <<EOF
167- cd ~/music-analytics/vm-deploy || exit 1
168- docker login ${REGISTRY_VAL} -u ${USERNAME_VAL} -p ${TOKEN_VAL} || exit 1
169- docker-compose pull || exit 1
170- docker-compose up -d || exit 1
171- docker logout ${REGISTRY_VAL}
172- echo "Deployment completed successfully"
173- EOF
174170 rm -f ssh_key.pem
175171
176172 - name : Log out from Oracle Container Registry
You can’t perform that action at this time.
0 commit comments