-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [demo] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- uses: mirromutth/[email protected] | ||
with: | ||
mysql database: laravel-test-db | ||
mysql user: laravel_test_user | ||
mysql password: example | ||
- name: Copy .env | ||
run: cp .env.example .env | ||
- name: Install composer Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Install node dependencies | ||
run: npm ci | ||
- name: Setup Project | ||
run: | | ||
php artisan config:clear | ||
php artisan cache:clear | ||
php artisan key:generate | ||
npm run build | ||
- name: Directory Permissions | ||
run: chmod 755 -R storage bootstrap/cache | ||
# - name: Run Unit tests | ||
# env: | ||
# APP_ENV: testing | ||
# DB_CONNECTION: mysql | ||
# DB_USERNAME: laravel_test_user | ||
# DB_PASSWORD: super_secret | ||
# DB_DATABASE: laravel_test_db | ||
# run: php artisan test | ||
- name: Deploy to Server | ||
if: ${{ success() }} | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
port: ${{ secrets.SSH_PORT }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
script_stop: true | ||
script: | | ||
cd domains | ||
cd lcommerce.net | ||
git pull | ||
composer install | ||
php artisan migrate --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.1' | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- uses: mirromutth/[email protected] | ||
with: | ||
mysql database: laravel-test-db | ||
mysql user: laravel_test_user | ||
mysql password: example | ||
- name: Copy .env | ||
run: cp .env.example .env | ||
- name: Install composer Dependencies | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Install node dependencies | ||
run: npm ci | ||
- name: Setup Project | ||
run: | | ||
php artisan config:clear | ||
php artisan cache:clear | ||
php artisan key:generate | ||
npm run build | ||
- name: Directory Permissions | ||
run: chmod 755 -R storage bootstrap/cache | ||
# - name: Run Unit tests | ||
# env: | ||
# APP_ENV: testing | ||
# DB_CONNECTION: mysql | ||
# DB_USERNAME: laravel_test_user | ||
# DB_PASSWORD: super_secret | ||
# DB_DATABASE: laravel_test_db | ||
# run: php artisan test | ||
- name: Deploy to Server | ||
if: ${{ success() }} | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
port: ${{ secrets.SSH_PORT }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
script_stop: true | ||
script: | | ||
cd domains | ||
cd lcommerce.net | ||
git pull | ||
composer install | ||
php artisan migrate --force |