Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jspekken's avatar

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

0 likes
3 replies
ChrisHardie's avatar

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.

bait-dept's avatar

What's the result of the deploy?

And what's with the --without-waiting ? I don't see that documented anywhere

jgrundtvig's avatar

@jspekken @chrishardie I experiencing the same issue - when compiled and deployed locally everything works, but when the project is deployed from a Github Action the solution is missing all kinds of stuff eg. reposotories. Did any of you find a solution to this issue??

@imrodrigoalves --without-waiting is closing down the deployment feedback from Vapor, preventing the unnecessary usage of minutes on Github Actions (Limited to 6000 min/month).

1 like

Please or to participate in this conversation.