jbrooksuk / laravel-forge-action

Deploy your application to Laravel Forge with GitHub Actions.
https://james.brooks.page
MIT License
81 stars 5 forks source link

Action Sends Response Before Complete #25

Open secondmanveran opened 1 year ago

secondmanveran commented 1 year ago

Hey again,

I have a branch remove job so that I can use temp branches just for deploying.

The laravel-forge-action is sending some sort of complete message before the deployment (on Forge) runs, so that my remove job is being triggered and the temp branch is removed and Forge can't find it.

Wed 01 Feb 2023 09:45:26 AM MST
fatal: couldn't find remote ref latest

The two jobs in question look like so:

deploy:
  name: Deploy to Laravel Forge
  needs: [compile, create, release]
  runs-on: ubuntu-latest

  steps:
    - name: Deploy Production Code
      uses: jbrooksuk/laravel-forge-action@v1.0.4
      with:
        api_key: ${{ secrets.FID }}
        server_id: ${{ secrets.SID }}
        site_id: ${{ secrets.WID }}

remove:
  name: Remove Latest Branch
  needs: [deploy, compile, create, release]
  runs-on: ubuntu-latest

  steps:
    - name: Delete Latest
      uses: dawidd6/action-delete-branch@v3
      with:
        github_token: ${{ secrets.VERAN }}
        branches: latest

How can I get this setup so that Forge doesn't send a success response until the deployment has actually started and fetched my latest branch?

Thanks

secondmanveran commented 1 year ago

@jbrooksuk

It looks like using the trigger_url instead of the api does the trick.

You may want to look into this though if you have time, sending the success response after the deployment is finished would be much better.

venux92 commented 9 months ago

Does not work for me. It does not seem to wait for Forge to report before jumping into the next step.

For example I had an error during my deploy on the composer update and it did not pickup.

Screenshot 2023-12-02 at 3 01 09 pm

I'm using the trigger_url way.