From 971fe7160fb9eb730e398d3528a739d9395eb5b8 Mon Sep 17 00:00:00 2001 From: Maulana Sodiqin Date: Tue, 25 Nov 2025 11:04:45 +0700 Subject: [PATCH] fix: handle local changes in deployment workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add git reset --hard before pull to discard any local changes on server: - Fetch latest changes from origin - Reset to origin/develop to discard local modifications - Then pull to update This fixes deployment failures caused by uncommitted local changes on the server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/deploy-backoffice.yml | 2 +- .github/workflows/deploy-dimentorin.yml | 2 +- .github/workflows/deploy-gacha.yml | 2 +- .github/workflows/deploy-hackathon.yml | 2 +- .github/workflows/deploy-landing.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-backoffice.yml b/.github/workflows/deploy-backoffice.yml index 4c2f433..ad2a898 100644 --- a/.github/workflows/deploy-backoffice.yml +++ b/.github/workflows/deploy-backoffice.yml @@ -26,7 +26,7 @@ jobs: if [ ! -d ~/imphnen-frontend-service-backoffice ]; then git clone https://github.com/IMPHNEN/imphnen-frontend-service.git ~/imphnen-frontend-service-backoffice else - cd ~/imphnen-frontend-service-backoffice && git pull + cd ~/imphnen-frontend-service-backoffice && git fetch origin && git reset --hard origin/develop && git pull fi echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > ~/imphnen-frontend-service-backoffice/apps/backoffice/.env docker compose -f ~/imphnen-frontend-service-backoffice/docker-compose-backoffice.yml down || true diff --git a/.github/workflows/deploy-dimentorin.yml b/.github/workflows/deploy-dimentorin.yml index 543f990..c131a03 100644 --- a/.github/workflows/deploy-dimentorin.yml +++ b/.github/workflows/deploy-dimentorin.yml @@ -26,7 +26,7 @@ jobs: if [ ! -d ~/imphnen-frontend-service-dimentorin ]; then git clone https://github.com/IMPHNEN/imphnen-frontend-service.git ~/imphnen-frontend-service-dimentorin else - cd ~/imphnen-frontend-service-dimentorin && git pull + cd ~/imphnen-frontend-service-dimentorin && git fetch origin && git reset --hard origin/develop && git pull fi echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > ~/imphnen-frontend-service-dimentorin/apps/dimentorin/.env docker compose -f ~/imphnen-frontend-service-dimentorin/docker-compose-dimentorin.yml down || true diff --git a/.github/workflows/deploy-gacha.yml b/.github/workflows/deploy-gacha.yml index 86c347d..4961c66 100644 --- a/.github/workflows/deploy-gacha.yml +++ b/.github/workflows/deploy-gacha.yml @@ -26,7 +26,7 @@ jobs: if [ ! -d ~/imphnen-frontend-service-gacha ]; then git clone https://github.com/IMPHNEN/imphnen-frontend-service.git ~/imphnen-frontend-service-gacha else - cd ~/imphnen-frontend-service-gacha && git pull + cd ~/imphnen-frontend-service-gacha && git fetch origin && git reset --hard origin/develop && git pull fi echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > ~/imphnen-frontend-service-gacha/apps/gacha/.env docker compose -f ~/imphnen-frontend-service-gacha/docker-compose-gacha.yml down || true diff --git a/.github/workflows/deploy-hackathon.yml b/.github/workflows/deploy-hackathon.yml index 43da13f..378c15e 100644 --- a/.github/workflows/deploy-hackathon.yml +++ b/.github/workflows/deploy-hackathon.yml @@ -26,7 +26,7 @@ jobs: if [ ! -d ~/imphnen-frontend-service-hackathon ]; then git clone https://github.com/IMPHNEN/imphnen-frontend-service.git ~/imphnen-frontend-service-hackathon else - cd ~/imphnen-frontend-service-hackathon && git pull + cd ~/imphnen-frontend-service-hackathon && git fetch origin && git reset --hard origin/develop && git pull fi echo "VITE_API_URL=${{ secrets.VITE_API_URL }}" > ~/imphnen-frontend-service-hackathon/apps/hackathon/.env docker compose -f ~/imphnen-frontend-service-hackathon/docker-compose-hackathon.yml down || true diff --git a/.github/workflows/deploy-landing.yml b/.github/workflows/deploy-landing.yml index 89cd15a..ba79773 100644 --- a/.github/workflows/deploy-landing.yml +++ b/.github/workflows/deploy-landing.yml @@ -26,7 +26,7 @@ jobs: if [ ! -d ~/imphnen-frontend-service ]; then git clone https://github.com/IMPHNEN/imphnen-frontend-service.git ~/imphnen-frontend-service else - cd ~/imphnen-frontend-service && git pull + cd ~/imphnen-frontend-service && git fetch origin && git reset --hard origin/develop && git pull fi echo "NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}" > ~/imphnen-frontend-service/apps/landing/.env docker compose -f ~/imphnen-frontend-service/docker-compose-landing.yml down || true