I'm trying to run docker commands in an ssh connection which was made from github actions. There I'm using even mention in the workflow. Here is my workflow
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
pull_request:
branches: ['main']
env:
REGISTRY: 'ghcr.io/testing/api-gateway'
IMAGE_NAME: ${{ format('{0}-{1}', github.event.repository.name, github.sha) }}
USERNAME: ${{ secrets.USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build
- name: Build & Push docker
run: docker build -t $REGISTRY:$IMAGE_NAME .
- name: Login to github package repository
run: echo $DOCKER_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
- name: Push docker image
run: docker push $REGISTRY:$IMAGE_NAME
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to Digital Ocean droplet via SSH action
uses: garygrossgarten/github-action-ssh@release
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USER }}
privateKey: ${{ secrets.DO_KEY }}
passphrase: ${{ secrets.DO_PASSPHRASE }}
command: |
echo $DOCKER_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
docker pull $REGISTRY:$IMAGE_NAME
docker run -p 3000:3000 $REGISTRY:$IMAGE_NAME
But I'm getting the following error when I run the workflow.
Run garygrossgarten/github-action-ssh@release
Establishing a SSH connection to ***.
using provided private key
(node:1514) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.