42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
name: Deploy
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
artifact_name:
|
|
required: true
|
|
type: string
|
|
environment:
|
|
required: true
|
|
type: string
|
|
deploy_path:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download build artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: ${{ inputs.artifact_name }}
|
|
path: ${{ inputs.artifact_name }}
|
|
|
|
# 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:
|
|
host: ${{ secrets.PI_MAIN_HOST }}
|
|
port: ${{ secrets.PI_MAIN_PORT }}
|
|
username: ${{ secrets.PI_MAIN_USERNAME }}
|
|
password: ${{ secrets.PI_MAIN_PASSWORD }}
|
|
source: "${{ inputs.artifact_name }}/*"
|
|
target: ${{ inputs.deploy_path }}
|
|
strip_components: 1
|
|
overwrite: true
|