I just hit what I think is the same issue today. When I build/deploy from my local machine, everything works fine. When I do it via GitHub actions following the official Vapor documentation, the app seems to be missing some assets. Specifically, in my CloudWatch HTTP logs I see things like "The Mix manifest does not exist." (when trying to access Laravel Nova URIs). The GitHub actions output indicates that npm building is working fine, so I'm not sure where to look next.
Deploy assets with Laravel Vapor and Github Actions
I'm trying to deploy my application to Laravel Vapor from Github actions. This works great but I'm running into some trouble with compiling and deploying my assets. When I compile and commit my assets (css, js) from my laptop everything works fine and Vapor correctly deploys those assets. But I don't want to manually compile and commit my assets, I'd like them to be compiled by a Github action and then deployed to Vapor ("automatically"). What am I doing wrong?
This is my action and vapor file:
name: Deploy with Github Actions
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy to Vapor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
- name: Deploy Environment
run: ./vendor/bin/vapor deploy --commit="${{ github.event.head_commit.id }}" --message="${{ github.event.head_commit.message }}" --without-waiting
env:
VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
id: 12345
name: an-awesome-application
environments:
staging:
domain:
- an-awesome-domain.co
- "*.an-awesome-domain.co"
gateway-version: 2
database: an-awesome-database
memory: 1024
cli-memory: 512
runtime: 'php-8.1:al2'
build:
- 'COMPOSER_MIRROR_PATH_REPOS=1 composer install --no-dev'
- 'npm ci && npm run production && rm -rf node_modules'
- 'php artisan event:cache'
deploy:
- 'php artisan migrate --force'
I have a app.css file and that will compile through laravel mix (works on my machine) and when I run vapor deploy locally everything works but not while running on Github Actions.
Any idea?
Thanks in advance
Please or to participate in this conversation.