Add automated test-environment deploy via SCP with nginx reverse proxy, domain names and SSL (certbot) setup

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-07-24 15:52:16 +02:00
co-authored by Junie
parent a437bad95b
commit 1ffe884eba
9 changed files with 273 additions and 61 deletions
+5 -3
View File
@@ -4,7 +4,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [main]
branches: [master]
jobs:
prepare:
@@ -103,10 +103,12 @@ jobs:
- name: Unit tests
run: pnpm run test
deploy:
deploy-test:
needs: [build, test]
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
uses: ./.gitea/workflows/deploy.yaml
secrets: inherit
with:
artifact_name: dist
environment: production
environment: test
deploy_path: /html/test/slpsoftware
+19 -9
View File
@@ -8,6 +8,9 @@ on:
environment:
required: true
type: string
deploy_path:
required: true
type: string
jobs:
deploy:
@@ -19,13 +22,20 @@ jobs:
name: ${{ inputs.artifact_name }}
path: dist
# Placeholder deploy step: voor nu wordt dist/ opnieuw gepubliceerd
# als duidelijk benoemde, downloadbare artifact. Zodra de hosting-/
# upload-methode (FTP/SFTP/anders) vastligt, vervang deze stap door
# de daadwerkelijke upload en kan deze opmerking weg.
- name: Package release artifact
uses: actions/upload-artifact@v3
# Uploadt de inhoud van dist/ via SCP (over SSH) naar de webroot van de
# test-omgeving (een Raspberry Pi achter een andere Raspberry Pi met
# nginx reverse proxy - zie operations/deployment/nginx/ voor de
# bijbehorende nginx-voorbeeldconfiguratie). Inloggegevens komen uit
# Gitea Actions Secrets (wachtwoord-login voor nu; zie
# deployment-instructions.md voor hoe je later naar een SSH-key omzet).
- name: Upload dist to ${{ inputs.environment }} web server via SCP
uses: appleboy/scp-action@v0.1.7
with:
name: release-dist
path: dist/
retention-days: 1
host: ${{ secrets.PI_TEST_HOST }}
port: ${{ secrets.PI_TEST_PORT }}
username: ${{ secrets.PI_TEST_USERNAME }}
password: ${{ secrets.PI_TEST_PASSWORD }}
source: "dist/*"
target: ${{ inputs.deploy_path }}
strip_components: 1
overwrite: true