Skip to content

Commit

Permalink
ci: fix build post (#1786)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Mar 15, 2024
1 parent f3b3325 commit 0fba461
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
env:
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message }}
BRANCH: ${{ github.ref_name }}
- name: Build site
run: yarn run site:build
- name: 'Deploy Site'
Expand Down
10 changes: 7 additions & 3 deletions scripts/ci/build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ buildVersion=$(node -pe "require('./package.json').version")
branchName=${BRANCH:-'master'}

buildVersionName="${buildVersion}-${commitSha}"
buildTagName="${branchName}-${commitSha}"
buildTagName=${TAG_NAME:-"${branchName}-${commitSha}"}
if [[ -n "${GITHUB_HEAD_REF}" ]]; then
buildTagName="${branchName}-${GITHUB_HEAD_REF}"
fi
buildCommitMessage="${branchName} - ${MESSAGE}"

repoUrl="https://github.com/ng-alain/${packageRepo}.git"
repoDir="${DIST}/${packageRepo}"

echo "Starting publish process ${buildVersionName} into ${branchName}.."
echo "Starting publish process ${buildVersionName} into ${branchName}(tag:${buildTagName}).."

rm -rf ${repoDir}
mkdir -p ${repoDir}
Expand Down Expand Up @@ -89,7 +92,8 @@ echo "https://${ACCESS_TOKEN}:@github.com" > .git/credentials

if [[ $(git ls-remote origin "refs/tags/${buildTagName}") ]]; then
echo "removed tag because tag is already published"
git push origin :refs/tags/${buildTagName}
# git push origin :refs/tags/${buildTagName}
git push --delete origin ${buildTagName}
fi

echo "Git configuration has been updated to match the last commit author. Publishing now.."
Expand Down

0 comments on commit 0fba461

Please sign in to comment.