-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.52 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
on:
workflow_call:
inputs:
environment_name:
description: Name of environment
required: true
type: string
secrets:
SSH_HOST:
description: SSH server to log in via SSH
required: true
SSH_USERNAME:
description: SSH username to log in via SSH
required: true
SSH_KEY:
description: SSH secret key to log in via SSH
required: true
ENVIRONMENT:
description: Environment file string to be used during deployment
required: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run deployment script on host server
uses: appleboy/[email protected]
env:
ENVIRONMENT_NAME: ${{ inputs.environment_name }}
REPO_NAME: ${{ github.event.repository.name }}
REPO_URL: https://github.com/${{ github.repository }}
REVISON: ${{ github.ref }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
envs: ENVIRONMENT_NAME,REPO_NAME,REPO_URL,REVISON,ENVIRONMENT
script_stop: true
script: |
curl -s https://raw.githubusercontent.com/Beuterei/reusable-workflows/main/deploy.bash > /tmp/deploy.bash
chmod +x /tmp/deploy.bash
bash /tmp/deploy.bash