-
Notifications
You must be signed in to change notification settings - Fork 15
54 lines (48 loc) · 1.48 KB
/
manual_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
48
49
50
51
52
53
name: manual_deploy
on:
workflow_dispatch:
inputs:
environment:
description: "Target Environment"
required: true
default: "dev"
type: choice
options:
- dev
- prod
service:
description: "Service"
required: true
type: choice
options:
- web_wiki
- web_usuaris
- service_wiki
- service_sso
version:
description: "Version"
required: true
default: "1.0.0"
jobs:
manual_deploy:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Get versions
id: versions
run: |
sso_service_version=$(grep version: ./config/dev/service_sso.yml | awk '{print $2}')
usuaris_web_version=$(grep version: ./config/dev/web_usuaris.yml | awk '{print $2}')
echo "::set-output name=sso_service_version::$sso_service_version"
echo "::set-output name=usuaris_web_version::$usuaris_web_version"
- name: Execute SSH Command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
script: |
echo "Deploying ${{ inputs.service }} SERVICE VERSION: ${{ inputs.version }}"
cd ${{ secrets.SSO_PATH }}/dev
bash deploy.sh ${{ inputs.service }} ${{ inputs.version }}