From e98b55332748db6c12728ce278f318328cc33474 Mon Sep 17 00:00:00 2001 From: Ujang Sopiyan Date: Mon, 1 Sep 2025 22:28:04 +0700 Subject: [PATCH 1/3] fix: deploy.yml - Menambahkan trigger edited - Menambahkan filter aksi --- .github/workflows/deploy.yml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6a503ce..3805fb5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,7 +2,7 @@ name: Deploy PBB Rilis with Ansible on: release: - types: [published] + types: [published, edited, prereleased] permissions: contents: read @@ -13,9 +13,13 @@ concurrency: jobs: deploy-production: - # Hanya jalan kalau rilis dari branch main & bukan prerelease - if: github.event.release.target_commitish == 'main' && github.event.release.prerelease == false - name: Deploy PBB Rilis to Production Server (Release) + # Hanya jalan kalau rilis dari branch main & bukan prerelease, + # serta event adalah published atau edited + if: | + github.event.release.target_commitish == 'main' && + github.event.release.prerelease == false && + (github.event.action == 'published' || github.event.action == 'edited') + name: Deploy PBB Rilis (Release) runs-on: ubuntu-latest steps: @@ -32,12 +36,17 @@ jobs: script: | set -euo pipefail cd ${{ secrets.CICD_SERVER_PATH }} - nohup ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-pbb-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}" > ~/ansible-update-pbb-rilis.log 2>&1 & + nohup ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-pbb-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}" > ~/tmp/ansible-deploy-pbb-rilis.log 2>&1 & + echo "Ansible playbook started in background. Check /tmp/ansible-deploy-pbb-rilis.log for output." deploy-prerelease: - # Hanya jalan kalau rilis dari branch main & prerelease = true - if: github.event.release.target_commitish == 'main' && github.event.release.prerelease == true - name: Deploy PBB Rilis to Production Server (Pre-Release) + # Hanya jalan kalau rilis dari branch main & prerelease = true, + # serta event adalah published atau edited + if: | + github.event.release.target_commitish == 'main' && + github.event.release.prerelease == true && + (github.event.action == 'published' || github.event.action == 'edited') + name: Deploy PBB Rilis (Pre-Release) runs-on: ubuntu-latest steps: @@ -54,4 +63,5 @@ jobs: script: | set -euo pipefail cd ${{ secrets.CICD_SERVER_PATH }} - nohup ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-pbb-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}" > ~/ansible-update-pbb-rilis.log 2>&1 & + nohup ansible-playbook -i inventories/production/inventory.yml playbooks/deploy-pbb-rilis.yml --extra-vars "release_tag=${{ github.event.release.tag_name }}" > ~/tmp/ansible-deploy-pbb-rilis.log 2>&1 & + echo "Ansible playbook started in background. Check /tmp/ansible-deploy-pbb-rilis.log for output." From 98ea8bb178321d11f585323b139f1b8e52ed9d03 Mon Sep 17 00:00:00 2001 From: Ujang Sopiyan Date: Mon, 1 Sep 2025 22:31:21 +0700 Subject: [PATCH 2/3] fix: deploy_siappakai.yml - Menambahkan trigger edited - Jalankan ansible di background --- .github/workflows/deploy_siappakai.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_siappakai.yml b/.github/workflows/deploy_siappakai.yml index 29c8803..a9d5807 100644 --- a/.github/workflows/deploy_siappakai.yml +++ b/.github/workflows/deploy_siappakai.yml @@ -2,7 +2,7 @@ name: Deploy SiapPakai Update PBB with Ansible on: release: - types: [published] + types: [published, edited, prereleased] permissions: contents: read @@ -32,4 +32,5 @@ jobs: script: | set -euo pipefail cd ${{ secrets.CICD_SERVER_PATH }} - nohup ansible-playbook -i inventories/production/inventory.yml playbooks/siappakai-update-pbb.yml --vault-password-file ~/.vault_pass.txt > ~/ansible-update-api-rilis.log 2>&1 & + nohup ansible-playbook -i inventories/production/inventory.yml playbooks/siappakai-update-pbb.yml --vault-password-file ~/.vault_pass.txt > ~/tmp/ansible-siappakai-update-pbb.log 2>&1 & + echo "Ansible playbook started in background. Check /tmp/ansible-siappakai-update-pbb.log for output." From 16a58122d1f0da055c3a5edcd37781b18e7e7ef2 Mon Sep 17 00:00:00 2001 From: Ujang Sopiyan Date: Tue, 2 Sep 2025 16:17:23 +0700 Subject: [PATCH 3/3] modify: deploy_siappakai.yml - Tambahkan filter kondisi edited --- .github/workflows/deploy_siappakai.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_siappakai.yml b/.github/workflows/deploy_siappakai.yml index a9d5807..6fba2ac 100644 --- a/.github/workflows/deploy_siappakai.yml +++ b/.github/workflows/deploy_siappakai.yml @@ -14,7 +14,10 @@ concurrency: jobs: deploy: # rilis dari branch 'main' & bukan prerelease - if: github.event.release.target_commitish == 'main' && github.event.release.prerelease == false + if: | + github.event.release.target_commitish == 'main' && + github.event.release.prerelease == false && + (github.event.action == 'published' || github.event.action == 'edited') name: Deploy SiapPakai Update PBB ke Server SiapPakai runs-on: ubuntu-latest