Skip to content

Commit 46f2deb

Browse files
authored
Merge pull request #792 from OpenSID/dev-ansible
Fitur: deploy dev dan deploy rilis
2 parents e04d5f2 + 4edaa27 commit 46f2deb

4 files changed

Lines changed: 70 additions & 70 deletions

File tree

.github/workflows/deploy_dev.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy OpenKab Dev with Ansible
2+
3+
on:
4+
pull_request:
5+
branches: [rilis-dev]
6+
types: [closed]
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: deploy-openkab-dev
13+
cancel-in-progress: true
14+
15+
jobs:
16+
deploy:
17+
if: github.event.pull_request.merged == true
18+
name: Deploy OpenKab Dev to Production Server
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout Ansible Code
23+
uses: actions/checkout@v4
24+
25+
- name: Deploy via SSH using appleboy/ssh-action
26+
uses: appleboy/ssh-action@v1.2.0
27+
with:
28+
host: ${{ secrets.CICD_SERVER_IP }}
29+
username: ${{ secrets.CICD_SERVER_USER }}
30+
key: ${{ secrets.CICD_SERVER_PRIVATE_KEY }}
31+
port: ${{ secrets.CICD_SERVER_PORT }}
32+
script: |
33+
set -euo pipefail
34+
cd ${{ secrets.CICD_SERVER_PATH }}
35+
ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-openkab-dev.yml

.github/workflows/deploy_prod.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/deploy_rilis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy OpenKab Rilis with Ansible
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: deploy-openkab-rilis
12+
cancel-in-progress: true
13+
14+
jobs:
15+
deploy:
16+
# rilis dari branch 'master' & bukan prerelease
17+
if: github.event.release.target_commitish == 'master' && github.event.release.prerelease == false
18+
name: Deploy OpenKab Rilis to Production Server
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout Ansible Code
23+
uses: actions/checkout@v4
24+
25+
- name: Deploy via SSH using appleboy/ssh-action
26+
uses: appleboy/ssh-action@v1.2.0
27+
with:
28+
host: ${{ secrets.CICD_SERVER_IP }}
29+
username: ${{ secrets.CICD_SERVER_USER }}
30+
key: ${{ secrets.CICD_SERVER_PRIVATE_KEY }}
31+
port: ${{ secrets.CICD_SERVER_PORT }}
32+
script: |
33+
set -euo pipefail
34+
cd ${{ secrets.CICD_SERVER_PATH }}
35+
ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-openkab-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}

.github/workflows/deploy_staging.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)