.gitea/workflows/dotnet-deploy.yml aktualisiert
Some checks failed
Build & Deploy .NET to 192.168.1.100 / build-and-deploy (push) Failing after 1m9s
Some checks failed
Build & Deploy .NET to 192.168.1.100 / build-and-deploy (push) Failing after 1m9s
This commit is contained in:
@@ -13,15 +13,13 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
# Variante 1: Mit Image-Label (siehe Runner-Konfiguration oben)
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Variante 2: Falls du keine Mapping-Labels hast, nutze:
|
|
||||||
# runs-on: [self-hosted, linux]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Host override setzen
|
- name: Host override setzen
|
||||||
run: |
|
run: |
|
||||||
echo "192.168.1.200 gitea.pldpro.at" >> /etc/hosts
|
echo "192.168.1.200 gitea.pldpro.at" >> /etc/hosts
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -44,12 +42,6 @@ jobs:
|
|||||||
-r "${{ env.RUNTIME }}" \
|
-r "${{ env.RUNTIME }}" \
|
||||||
--self-contained true \
|
--self-contained true \
|
||||||
-o "${{ env.PUBLISH_DIR }}"
|
-o "${{ env.PUBLISH_DIR }}"
|
||||||
# --- Alternative (framework-dependent) ---
|
|
||||||
# - name: Publish (framework-dependent)
|
|
||||||
# run: |
|
|
||||||
# dotnet publish "${{ env.PROJECT_PATH }}" \
|
|
||||||
# -c Release \
|
|
||||||
# -o "${{ env.PUBLISH_DIR }}"
|
|
||||||
|
|
||||||
- name: Prepare SSH key & known_hosts
|
- name: Prepare SSH key & known_hosts
|
||||||
env:
|
env:
|
||||||
@@ -64,6 +56,15 @@ jobs:
|
|||||||
PORT="${SSH_PORT:-22}"
|
PORT="${SSH_PORT:-22}"
|
||||||
ssh-keyscan -p "${PORT}" -H "${SSH_HOST}" >> ~/.ssh/known_hosts
|
ssh-keyscan -p "${PORT}" -H "${SSH_HOST}" >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Remove previous installed version
|
||||||
|
env:
|
||||||
|
SSH_USER: ${{ secrets.SSH_USER }}
|
||||||
|
SSH_HOST: ${{ secrets.SSH_HOST }}
|
||||||
|
SSH_PORT: ${{ secrets.SSH_PORT }}
|
||||||
|
REMOTE_DIR: ${{ secrets.REMOTE_DIR }}
|
||||||
|
run: |
|
||||||
|
ssh -i ~/.ssh/id_deploy -p "${SSH_PORT:-22}" "${SSH_USER}@${SSH_HOST}" "rm -rf '${REMOTE_DIR}'"
|
||||||
|
|
||||||
- name: Create remote directory
|
- name: Create remote directory
|
||||||
env:
|
env:
|
||||||
SSH_USER: ${{ secrets.SSH_USER }}
|
SSH_USER: ${{ secrets.SSH_USER }}
|
||||||
@@ -93,6 +94,6 @@ jobs:
|
|||||||
SERVICE_NAME: ${{ secrets.SERVICE_NAME }}
|
SERVICE_NAME: ${{ secrets.SERVICE_NAME }}
|
||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/id_deploy -p "${SSH_PORT:-22}" "${SSH_USER}@${SSH_HOST}" \
|
ssh -i ~/.ssh/id_deploy -p "${SSH_PORT:-22}" "${SSH_USER}@${SSH_HOST}" \
|
||||||
"sudo systemctl daemon-reload && sudo systemctl restart '${SERVICE_NAME}' && sudo systemctl status --no-pager '${SERVICE_NAME}'"
|
"systemctl daemon-reload && systemctl restart '${SERVICE_NAME}' && systemctl status --no-pager '${SERVICE_NAME}'"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user