update workflow again #57
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
on: push | |
name: 🚀 Build & Deploy | |
jobs: | |
web-deploy: | |
name: Build & Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get latest code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Cache Composer packages | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-php- | |
- name: Install Composer dependencies | |
run: composer install --prefer-dist --no-progress | |
- name: Setup Node / NPM | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Cache NPM packages | |
id: npm-cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm- | |
- name: NPM install | |
run: npm install | |
- name: NPM build | |
run: npm run build | |
- name: Deploy files | |
uses: pressidium/lftp-mirror-action@v1 | |
with: | |
host: 141.138.138.119 | |
user: ${{ secrets.ssh_username }} | |
pass: ${{ secrets.ssh_password }} | |
remoteDir: '/home/pool_joeke_dev/htdocs' | |
parallel: 6 | |
options: '--verbose' | |
- name: Run Laravel migrations | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: 141.138.138.119 | |
username: ${{ secrets.ssh_username }} | |
password: ${{ secrets.ssh_password }} | |
script: cd /home/pool_joeke_dev/htdocs && php artisan migrate --force |