Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy OpenKab Dev with Ansible

on:
pull_request:
branches: [rilis-dev]
types: [closed]

permissions:
contents: read

concurrency:
group: deploy-openkab-dev
cancel-in-progress: true

jobs:
deploy:
if: github.event.pull_request.merged == true
name: Deploy OpenKab Dev to Production Server
runs-on: ubuntu-latest

steps:
- name: Checkout Ansible Code
uses: actions/checkout@v4

- name: Deploy via SSH using appleboy/ssh-action
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.CICD_SERVER_IP }}
username: ${{ secrets.CICD_SERVER_USER }}
key: ${{ secrets.CICD_SERVER_PRIVATE_KEY }}
port: ${{ secrets.CICD_SERVER_PORT }}
script: |
set -euo pipefail
cd ${{ secrets.CICD_SERVER_PATH }}
ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-openkab-dev.yml
35 changes: 0 additions & 35 deletions .github/workflows/deploy_prod.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/deploy_rilis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy OpenKab Rilis with Ansible

on:
release:
types: [published]

permissions:
contents: read

concurrency:
group: deploy-openkab-rilis
cancel-in-progress: true

jobs:
deploy:
# rilis dari branch 'master' & bukan prerelease
if: github.event.release.target_commitish == 'master' && github.event.release.prerelease == false
name: Deploy OpenKab Rilis to Production Server
runs-on: ubuntu-latest

steps:
- name: Checkout Ansible Code
uses: actions/checkout@v4

- name: Deploy via SSH using appleboy/ssh-action
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.CICD_SERVER_IP }}
username: ${{ secrets.CICD_SERVER_USER }}
key: ${{ secrets.CICD_SERVER_PRIVATE_KEY }}
port: ${{ secrets.CICD_SERVER_PORT }}
script: |
set -euo pipefail
cd ${{ secrets.CICD_SERVER_PATH }}
ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-openkab-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}
35 changes: 0 additions & 35 deletions .github/workflows/deploy_staging.yml

This file was deleted.