Skip to content

ajustando Dockerfile e pipeline #45

ajustando Dockerfile e pipeline

ajustando Dockerfile e pipeline #45

Workflow file for this run

name: CD-Sonar Metrics Collector
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
name: Deploy-ssh
runs-on: ubuntu-latest
steps:
- name: 'Create env file'
run: |
touch .env.
echo SONAR_USER_TOKEN=${{ secrets.SONAR_USER_TOKEN }} >> .env
cat .env
- name: Executing remote ssh commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd db1-projects/sonar-metrics-collector/;
docker container stop sonar-metrics-collector;
docker rm sonar-metrics-collector;
git pull origin main;
docker rmi sonar-metrics-collector;
docker build -t sonar-metrics-collector .;
docker run -d -t -i -p 5100:5100 --net metrics-collector --name sonar-metrics-collector sonar-metrics-collector:latest npm run start:prod