Merge pull request 'complete ci-cd implementation' (#1) from feat/ci-cd into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-09-17 06:54:57 +00:00
2 changed files with 59 additions and 4 deletions
+58
View File
@@ -0,0 +1,58 @@
name: CI/CD - erp auth
on:
pull_request:
branches:
- production
types:
- closed
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: linux
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
run: |
git clone \
--depth 1 \
--branch production \
https://oauth2:${{ secrets.ERPAUTH }}@gitea.hexdive.com/New_REP_SYSTEM/ERP_Auth_Service.git \
.
- name: Restore
run: dotnet restore AuthHex.sln
- name: Publish
run: |
dotnet publish AuthHex.csproj \
-c Release \
-r linux-x64 \
--self-contained true \
-o /tmp/authhex-deploy
- name: Stop service
run: systemctl stop erpAuth.service || true
- name: Deploy
run: |
cp -r /tmp/authhex-deploy/* /var/www/internalServices/erpAuth/publish/
- name: Fix ownership and permissions
run: |
chown -R hexafitauth:hexafitauth /var/www/internalServices/erpAuth/publish/
find /var/www/internalServices/erpAuth/publish/ -type d -exec chmod 755 {} +
find /var/www/internalServices/erpAuth/publish/ -type f -exec chmod 644 {} +
chmod +x /var/www/internalServices/erpAuth/publish/AuthHex
- name: Start service
run: systemctl start erpAuth.service
- name: Verify
run: |
sleep 3
systemctl is-active erpAuth.service \
&& echo "Service running" \
|| (journalctl -u erpAuth.service -n 30 --no-pager && exit 1)
+1 -4
View File
@@ -18,10 +18,7 @@
"Kestrel": { "Kestrel": {
"Endpoints": { "Endpoints": {
"Http": { "Http": {
"Url": "http://0.0.0.0:5011" "Url": "http://0.0.0.0:6703"
},
"Https": {
"Url": "https://0.0.0.0:7111"
} }
}, },
"AllowedOrigins": [ "*" ] "AllowedOrigins": [ "*" ]