refactor: simplify deployment logic and remove redundant commands in GitHub Actions workflow
This commit is contained in:
@@ -27,31 +27,20 @@ jobs:
|
||||
php -v
|
||||
|
||||
BRANCH="production"
|
||||
REPO_URL="${{ secrets.REPO_URL }}"
|
||||
|
||||
cd httpdocs
|
||||
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
if [ ! -d ".git" ]; then
|
||||
echo "First deploy..."
|
||||
|
||||
rm -rf ./*
|
||||
|
||||
git clone -b "$BRANCH" "$REPO_URL" .
|
||||
else
|
||||
if test -d .git; then
|
||||
echo "Updating source..."
|
||||
|
||||
git fetch origin
|
||||
|
||||
git reset --hard origin/$BRANCH
|
||||
fi
|
||||
else
|
||||
echo "First deploy..."
|
||||
|
||||
composer install \
|
||||
--no-dev \
|
||||
--optimize-autoloader \
|
||||
--no-interaction
|
||||
git clone -b "$BRANCH" "${{ secrets.REPO_URL }}" .
|
||||
fi
|
||||
|
||||
php artisan migrate --force
|
||||
|
||||
|
||||
Reference in New Issue
Block a user