fix(ci): drop lint from staging deploy; fix revert for merge commits (BIT-21923)
ai-news-writer-ci / test (pull_request) Successful in 1m1s
ai-news-writer-ci / test (pull_request) Successful in 1m1s
- Remove `npm run lint --quiet` from SSH deploy step: eslint is a devDependency excluded by --omit=dev, and CI already passed lint before the merge — re-running on staging is both redundant and broken. - Change `git revert HEAD --no-edit` to `git revert HEAD -m 1 --no-edit` so the rollback step handles merge commits correctly.
This commit is contained in:
1 parent
4151c1da52
commit
6fe72a304b
1 file changed
+2
-2
@@ -45,7 +45,7 @@ jobs:
|
||||
set -euo pipefail
|
||||
BRANCH="${STAGING_GIT_BRANCH:?STAGING_GIT_BRANCH is required}"
|
||||
bash tools/ci/gitea-actions-ssh-config.sh staging "$STAGING_HOST" "$STAGING_USER" "$STAGING_PORT" "$STAGING_SSH_KEY" "$STAGING_SSH_KNOWN_HOSTS"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev && npm run lint --quiet"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && pm2 startOrReload ecosystem.config.cjs --update-env"
|
||||
|
||||
- name: Health check — staging
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
bash tools/ci/gitea-actions-ssh-config.sh staging "$STAGING_HOST" "$STAGING_USER" "$STAGING_PORT" "$STAGING_SSH_KEY" "$STAGING_SSH_KNOWN_HOSTS"
|
||||
echo "Attempting automatic rollback to previous commit..."
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git log --oneline -2"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git revert HEAD --no-edit && git push origin ${BRANCH}"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git revert HEAD -m 1 --no-edit && git push origin ${BRANCH}"
|
||||
ssh -F "${HOME}/.ssh/gitea_ci_staging.conf" staging "cd /opt/bitreport/ai-news-writer && git fetch origin && git pull --ff-only origin ${BRANCH} && npm ci --omit=dev && pm2 startOrReload ecosystem.config.cjs --update-env"
|
||||
echo "Staging deployment failed — rollback attempted"
|
||||
exit 1
|
||||
|
||||
Reference in new issue
Block a user