-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:db1group/sonar-metrics-collector
- Loading branch information
Showing
3 changed files
with
18 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,35 +3,26 @@ name: CD-Sonar Metrics Collector | |
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Deploy-ssh | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
- name: Executing remote ssh commands | ||
uses: appleboy/[email protected] | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: NPM install and build | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Deploy-ssh | ||
run: | | ||
ssh-keyscan -t rsa -p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts | ||
ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} ' | ||
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 || true; | ||
docker rm sonar-metrics-collector || true; | ||
docker container stop sonar-metrics-collector; | ||
docker rm sonar-metrics-collector; | ||
git pull origin main; | ||
docker rmi sonar-metrics-collector || true; | ||
docker rmi sonar-metrics-collector; | ||
docker build -t sonar-metrics-collector .; | ||
docker run -d -t -i -e npm run start:prod -p 5100:5100 --name sonar-metrics-collector 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters