Merge pull request 'Testing out workflow...' (#22) from docker-deploy-workflow-v1 into main
Reviewed-on: Trez.One/rinoa-docker#22
This commit is contained in:
+16
-18
@@ -15,14 +15,12 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: SonarQube Scan
|
- name: SonarQube Scan
|
||||||
id: sonarqube-scan
|
id: sonarqube-scan
|
||||||
uses: SonarSource/sonarqube-scan-action@v4.0.0
|
uses: SonarSource/sonarqube-scan-action@v4.1.0
|
||||||
env:
|
env:
|
||||||
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
|
||||||
- name: SonarQube Quality Gate Check
|
- name: SonarQube Quality Gate Check
|
||||||
id: quality-gate
|
id: quality-gate
|
||||||
uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
|
uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
|
||||||
@@ -40,11 +38,9 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Generate ephemeral env
|
- name: Generate ephemeral env
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.RINOA_DOCKER_ENV }}" > ./.env
|
echo "${{ secrets.RINOA_DOCKER_ENV }}" > ./.env
|
||||||
|
|
||||||
- name: Validate Docker Compose Configuration
|
- name: Validate Docker Compose Configuration
|
||||||
id: docker-lint
|
id: docker-lint
|
||||||
run: |
|
run: |
|
||||||
@@ -57,6 +53,21 @@ jobs:
|
|||||||
echo "Docker Compose configuration is valid."
|
echo "Docker Compose configuration is valid."
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=exit_code::$EXIT_CODE"
|
echo "::set-output name=exit_code::$EXIT_CODE"
|
||||||
|
- name: Merge PR in Gitea
|
||||||
|
needs: docker-lint
|
||||||
|
if: steps.docker-lint.outputs.exit_code == 0
|
||||||
|
uses: prasiman/gocurl@v1
|
||||||
|
if: ${{ github.event.pull_request.merged == false }} # Only merge if PR is not already merged
|
||||||
|
with:
|
||||||
|
method: "POST"
|
||||||
|
url: "${{ secrets.RINOA_GITEA_SERVER }}/api/v1/repos/${{ github.repository_owner }}/${{ github.event.repository.name }}/pulls/${{ github.event.pull_request.number }}/merge"
|
||||||
|
headers: >
|
||||||
|
Authorization: token "${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
|
Content-Type: application/json
|
||||||
|
body: |
|
||||||
|
{
|
||||||
|
"Do": "merge"
|
||||||
|
}
|
||||||
|
|
||||||
deploy-changes:
|
deploy-changes:
|
||||||
name: Merge and Deploy Changes
|
name: Merge and Deploy Changes
|
||||||
@@ -66,25 +77,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# - name: Install & Setup Tea CLI
|
|
||||||
# run: |
|
|
||||||
# curl -sSL https://dl.gitea.com/tea/main/tea-main-linux-amd64 -o /usr/local/bin/tea
|
|
||||||
# chmod +x /usr/local/bin/tea
|
|
||||||
# tea login add --name gitea-rinoa --url "${{ secrets.RINOA_GITEA_SERVER }}" --user gitea-sonarqube-bot --password "${{ secrets.BOT_GITEA_PASSWORD }}" --token "${{ secrets.BOT_GITEA_TOKEN }}"
|
|
||||||
|
|
||||||
# - name: Merge PR with Tea CLI
|
|
||||||
# run: |
|
|
||||||
# echo "${{ gitea.event.pull_request.number }}"
|
|
||||||
# tea pr m --repo "${{ gitea.repository.name }}" --message "Automatically merged by GitHub Actions" --output table "${{ gitea.event.pull_request.number }}"
|
|
||||||
|
|
||||||
- name: Git Merge & Push
|
- name: Git Merge & Push
|
||||||
uses: morbalint/git-merge-action@v1.1.0
|
uses: morbalint/git-merge-action@v1.1.0
|
||||||
with:
|
with:
|
||||||
target: 'main'
|
target: 'main'
|
||||||
source: ${{ gitea.event.pull_request.head.ref }}
|
source: ${{ gitea.event.pull_request.head.ref }}
|
||||||
dry-run: true
|
dry-run: true
|
||||||
|
|
||||||
- name: Deploy Docker Compose Changes
|
- name: Deploy Docker Compose Changes
|
||||||
uses: 5eqn/docker-compose-remote-action@v0.0.7
|
uses: 5eqn/docker-compose-remote-action@v0.0.7
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -6474,42 +6474,6 @@ services:
|
|||||||
source: /var/run/docker.sock
|
source: /var/run/docker.sock
|
||||||
target: /var/run/docker.sock
|
target: /var/run/docker.sock
|
||||||
type: bind
|
type: bind
|
||||||
watchyourlan:
|
|
||||||
container_name: watchyourlan
|
|
||||||
environment:
|
|
||||||
DBPATH: /data/db.sqlite
|
|
||||||
GUIIP: 0.0.0.0
|
|
||||||
GUIPORT: "8840"
|
|
||||||
IFACE: eno4
|
|
||||||
IGNOREIP: "no"
|
|
||||||
SHOUTRRR_URL: ""
|
|
||||||
THEME: darkly
|
|
||||||
TIMEOUT: "120"
|
|
||||||
TZ: America/New_York
|
|
||||||
image: aceberg/watchyourlan
|
|
||||||
labels:
|
|
||||||
- homepage.group=Infrastructure/App Performance Monitoring
|
|
||||||
- homepage.name=WatchYourLAN
|
|
||||||
- homepage.href=https://wyl.${MY_TLD}
|
|
||||||
- homepage.icon=watchyourlan.png
|
|
||||||
- homepage.description=Lightweight network IP scanner
|
|
||||||
- swag=enable
|
|
||||||
- swag_proto=http
|
|
||||||
- swag_url=wyl.trez
|
|
||||||
- swag_port=8840
|
|
||||||
network_mode: host
|
|
||||||
ports:
|
|
||||||
- mode: ingress
|
|
||||||
protocol: tcp
|
|
||||||
published: "8840"
|
|
||||||
target: 8840
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- source: ${DOCKER_VOLUME_CONFIG}/watchyourlan
|
|
||||||
target: /data
|
|
||||||
type: bind
|
|
||||||
bind:
|
|
||||||
create_host_path: true
|
|
||||||
wazuh.agent:
|
wazuh.agent:
|
||||||
container_name: wazuh.agent
|
container_name: wazuh.agent
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user