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