Skip to content

Commit

Permalink
add ssh step
Browse files Browse the repository at this point in the history
  • Loading branch information
BdsOliveira committed Feb 20, 2024
1 parent 262f9eb commit a062851
Showing 1 changed file with 36 additions and 25 deletions.
61 changes: 36 additions & 25 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,37 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-versions }}
# extensions: mbstring, dom, fileinfo, pdo_sqlite
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, pdo_sqlite

# - name: Install Composer dependencies
# run: composer update --no-progress --prefer-dist --optimize-autoloader
- name: Install Composer dependencies
run: composer update --no-progress --prefer-dist --optimize-autoloader

# - name: Prepare the application
# run: |
# php -r "file_exists('.env') || copy('.env.example', '.env');"
# php artisan key:generate
- name: Prepare the application
run: |
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
# - name: Directory Permissions
# run: chmod -R 777 storage bootstrap/cache
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache

# - name: Clear Config
# run: php artisan config:clear
- name: Clear Config
run: php artisan config:clear

# - name: Create Database
# run: touch database/database.sqlite
- name: Create Database
run: touch database/database.sqlite

# - name: Migrate Database
# env:
# DB_CONNECTION: sqlite
# DB_DATABASE: database/database.sqlite
# run: php artisan migrate
- name: Migrate Database
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan migrate

# - name: Test with phpunit
# run: vendor/bin/phpunit --testdox
- name: Test with phpunit
run: vendor/bin/phpunit --testdox

deploy-develop:
name: Deploy to dev Enviroment
Expand All @@ -64,7 +64,7 @@ jobs:
run: echo "Deploying to develop environment"

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Deploy to ${{ vars.SERVER_DIR }}
uses: SamKirkland/FTP-Deploy-Action@master
Expand All @@ -74,6 +74,17 @@ jobs:
password: ${{ secrets.FTP_PASSWORD }}
server-dir: ${{ vars.SERVER_DIR }}

- name: Executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
port: ${{ secrets.PORT }}
script: |
cd ${{ vars.SERVER_DIR }}
composer update
deploy-homologacao:
name: Deploy to hmg Enviroment
runs-on: ubuntu-latest
Expand Down

0 comments on commit a062851

Please sign in to comment.