mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Create action-deploy.sh
This commit is contained in:
parent
19b29b4aad
commit
5f9c65156d
29
action-deploy.sh
Normal file
29
action-deploy.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/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 add origin "${remote_repo}"
|
||||
|
||||
git push -u origin deploy --force
|
||||
Loading…
x
Reference in New Issue
Block a user