ci: auto mkdir + git init in pipeline
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-02-27 17:36:02 +00:00
parent f04c647d3a
commit 918f03ef79

View File

@@ -3,9 +3,11 @@ pipeline:
image: alpine/git image: alpine/git
secrets: [ DEPLOY_PATH ] secrets: [ DEPLOY_PATH ]
commands: commands:
- mkdir -p $DEPLOY_PATH
- cd $DEPLOY_PATH - cd $DEPLOY_PATH
- if [ ! -d ".git" ]; then git init; fi
- git config --global --add safe.directory $DEPLOY_PATH - git config --global --add safe.directory $DEPLOY_PATH
- git remote set-url origin https://git.sukabelajar.web.id/${CI_REPO}.git || true - git remote set-url origin https://git.sukabelajar.web.id/${CI_REPO}.git 2>/dev/null || git remote add origin https://git.sukabelajar.web.id/${CI_REPO}.git
- git fetch origin ${CI_COMMIT_BRANCH} - git fetch origin ${CI_COMMIT_BRANCH}
- git reset --hard origin/${CI_COMMIT_BRANCH} - git reset --hard origin/${CI_COMMIT_BRANCH}
- echo "✅ Deploy ${CI_REPO_NAME} selesai!" - echo "✅ Deploy ${CI_REPO_NAME} selesai!"