From ca130f51bb5f87846748aaa3c1ad4d80dd967fdf Mon Sep 17 00:00:00 2001 From: Ujang Sopiyan Date: Thu, 21 Aug 2025 08:41:22 +0700 Subject: [PATCH 1/2] feat: [deploy] --- .github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..28c40a87 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy Helpdesk with Ansible + +on: + pull_request: + branches: [development] + # types: [closed] + +permissions: + contents: read + +concurrency: + group: deploy-helpdesk + cancel-in-progress: true + +jobs: + deploy: + # if: github.event.pull_request.merged == true + name: Deploy Helpdesk 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-helpdesk.yml From 328a97876f6ecdc72b07092b2652043ab3f0b8a7 Mon Sep 17 00:00:00 2001 From: Ujang Sopiyan Date: Thu, 21 Aug 2025 08:44:06 +0700 Subject: [PATCH 2/2] done: [deploy] --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 28c40a87..a99d4eed 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,7 +3,7 @@ name: Deploy Helpdesk with Ansible on: pull_request: branches: [development] - # types: [closed] + types: [closed] permissions: contents: read @@ -14,7 +14,7 @@ concurrency: jobs: deploy: - # if: github.event.pull_request.merged == true + if: github.event.pull_request.merged == true name: Deploy Helpdesk to Production Server runs-on: ubuntu-latest