Fix workflow #42
Workflow file for this run
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
name: Deploy | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache/files | |
key: php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | |
restore-keys: php-${{ matrix.php }}-composer- | |
- name: Setup PHP | |
uses: shivammathur/[email protected] | |
with: | |
php-version: 8.2 | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick | |
coverage: xdebug | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-interaction --no-suggest | |
- name: Execute tests | |
run: composer run tests | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
environment: 'Production' | |
needs: | |
- tests | |
steps: | |
- name: Deploy to production server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USER }} | |
password: ${{ secrets.SSH_PASS }} | |
script: | | |
cd ${{ secrets.PROJECT_PATH}} | |
php8.2 artisan down | |
git reset --hard | |
git fetch origin | |
git pull "https://Lukasss93:${{ secrets.GIT_TOKEN }}@github.com/Lukasss93/telegram-stickeroptimizer.git" master | |
php8.2 composer.phar install --no-dev --optimize-autoloader --no-ansi --no-interaction --no-progress | |
php8.2 artisan migrate --force --step | |
php8.2 artisan optimize:clear | |
php8.2 artisan optimize | |
php8.2 artisan view:cache | |
php8.2 artisan event:cache | |
php8.2 artisan storage:link | |
php8.2 artisan nutgram:register-commands | |
php8.2 artisan stats:update | |
php8.2 artisan up | |
echo 'DONE!' |