We are trying to use Bitbucket Pipelines to deploy a basic angular application to a VM on Google Cloud but are not sure how to use SSH key to connect to the server to copy the build files. Looking for examples but could not find.
We were able to do the same manually using Putty/SSH commands to copy the dist files.
We have the public/private key from Google Cloud's VM, and added them to Bitbucket Pipelines > SSH Keys
Our YML script is as below:
image: node:6.9.4
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm install -g @angular/cli@1.6.4
- ng build --prod
- cd dist/
- ssh -i ???