fixing test and deploy script
This commit is contained in:
@@ -75,36 +75,14 @@ jobs:
|
|||||||
- name: Build frontend assets
|
- name: Build frontend assets
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Upload deployment artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: laravel-build
|
|
||||||
path: |
|
|
||||||
app
|
|
||||||
bootstrap
|
|
||||||
config
|
|
||||||
database
|
|
||||||
public
|
|
||||||
resources
|
|
||||||
routes
|
|
||||||
vendor
|
|
||||||
artisan
|
|
||||||
composer.json
|
|
||||||
package.json
|
|
||||||
vite.config.js
|
|
||||||
if-no-files-found: ignore
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy
|
name: Deploy
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifact
|
- name: Checkout repository
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
name: laravel-build
|
|
||||||
path: release
|
|
||||||
|
|
||||||
- name: Install sshpass
|
- name: Install sshpass
|
||||||
run: sudo apt-get update && sudo apt-get install -y sshpass
|
run: sudo apt-get update && sudo apt-get install -y sshpass
|
||||||
@@ -139,11 +117,14 @@ jobs:
|
|||||||
rsync -az --delete \
|
rsync -az --delete \
|
||||||
-e "sshpass -e ssh -p ${DEPLOY_PORT:-22}" \
|
-e "sshpass -e ssh -p ${DEPLOY_PORT:-22}" \
|
||||||
--exclude='.env' \
|
--exclude='.env' \
|
||||||
|
--exclude='.git' \
|
||||||
--exclude='storage/logs/*' \
|
--exclude='storage/logs/*' \
|
||||||
--exclude='storage/framework/cache/*' \
|
--exclude='storage/framework/cache/*' \
|
||||||
--exclude='storage/framework/sessions/*' \
|
--exclude='storage/framework/sessions/*' \
|
||||||
--exclude='storage/framework/views/*' \
|
--exclude='storage/framework/views/*' \
|
||||||
release/ "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}"
|
--exclude='vendor' \
|
||||||
|
--exclude='node_modules' \
|
||||||
|
. "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}"
|
||||||
|
|
||||||
- name: Create .env on server from secret
|
- name: Create .env on server from secret
|
||||||
env:
|
env:
|
||||||
@@ -167,7 +148,7 @@ jobs:
|
|||||||
|
|
||||||
printf '%s' "$DEPLOY_ENV_FILE" | sshpass -e ssh -p "${DEPLOY_PORT:-22}" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p \"${DEPLOY_PATH}\" && cat > \"${DEPLOY_PATH}/.env\" && chmod 600 \"${DEPLOY_PATH}/.env\""
|
printf '%s' "$DEPLOY_ENV_FILE" | sshpass -e ssh -p "${DEPLOY_PORT:-22}" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p \"${DEPLOY_PATH}\" && cat > \"${DEPLOY_PATH}/.env\" && chmod 600 \"${DEPLOY_PATH}/.env\""
|
||||||
|
|
||||||
- name: Run post-deploy Laravel commands
|
- name: Install dependencies and build on server
|
||||||
env:
|
env:
|
||||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
|
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
|
||||||
@@ -181,7 +162,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sshpass -e ssh -p "${DEPLOY_PORT:-22}" "${DEPLOY_USER}@${DEPLOY_HOST}" "cd ${DEPLOY_PATH} && php artisan optimize:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache"
|
sshpass -e ssh -p "${DEPLOY_PORT:-22}" "${DEPLOY_USER}@${DEPLOY_HOST}" "cd ${DEPLOY_PATH} && composer install --no-dev --optimize-autoloader && npm ci && npm run build && php artisan optimize:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache"
|
||||||
|
|
||||||
# Required repository secrets:
|
# Required repository secrets:
|
||||||
# - DEPLOY_HOST: Server hostname or IP.
|
# - DEPLOY_HOST: Server hostname or IP.
|
||||||
|
|||||||
Reference in New Issue
Block a user