mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
31 lines
817 B
Bash
31 lines
817 B
Bash
#!/usr/bin/env bash
|
|
|
|
if [ -n "${GITHUB_TOKEN}" ]; then
|
|
print_info "setup with GITHUB_TOKEN"
|
|
remote_repo="https://x-access-token:${GITHUB_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git"
|
|
elif [ -n "${PERSONAL_TOKEN}" ]; then
|
|
print_info "setup with PERSONAL_TOKEN"
|
|
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git"
|
|
fi
|
|
|
|
if ! git config --get user.name; then
|
|
git config --global user.name "${GITHUB_ACTOR}"
|
|
fi
|
|
|
|
if ! git config --get user.email; then
|
|
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}"
|
|
fi
|
|
|
|
cd dist
|
|
|
|
git init -b deploy
|
|
|
|
git add .
|
|
|
|
git commit -m "automatic deployment"
|
|
|
|
git remote rm origin
|
|
git remote add origin "${remote_repo}"
|
|
|
|
git push -u origin deploy --force
|