Code Monkey home page Code Monkey logo

laravel-forge-action's Introduction

Laravel Forge GitHub Action

Deploy your application to Laravel Forge with GitHub Actions.

Credit

Heavily based on Glennmen/ploi-deploy-action ❤️

Inputs

It is highly recommended that you store all inputs using GitHub Secrets.

Input Description
trigger_url When using the trigger url to deploy your application, this field is required. You can find this within your site's detail panel in Forge.
api_key If you want to use the API to deploy your application, you must provide api_key, server_id and site_id.

You can generate an API key in your Forge dashboard.
server_id You can find the ID of the server in the server's detail panel.
site_id You can find the ID of the site in the site's detail panel.

Examples

Deploy via Deployment Trigger URL

name: 'Deploy on push'

on:
  push:
    branches:
      - master

jobs:
  forge-deploy:
    name: 'Laravel Forge Deploy'
    runs-on: ubuntu-latest

    steps:
      # Trigger Laravel Forge Deploy
      - name: Deploy
        uses: jbrooksuk/[email protected]
        with:
          trigger_url: ${{ secrets.TRIGGER_URL }}

Deploy via API

name: 'Deploy on push'

on:
  push:
    branches:
      - master

jobs:
  forge-deploy:
    name: 'Laravel Forge Deploy'
    runs-on: ubuntu-latest

    steps:
      # Trigger Laravel Forge Deploy
      - name: Deploy
        uses: jbrooksuk/[email protected]
        with:
          api_key: ${{ secrets.API_KEY }}
          server_id: ${{ secrets.SERVER_ID }}
          site_id: ${{ secrets.SITE_ID }}

laravel-forge-action's People

Contributors

dependabot[bot] avatar gregkos avatar jbrooksuk avatar samuelnitsche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-forge-action's Issues

URL 400 Error v1.0.3

No matter which method I try, trigger_url or api I get the following error using the latest 1.0.3 version.

curl: (22) The requested URL returned error: 400

When I switch back to 1.0.2 both methods work as expected.

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

  steps:
    - name: Deploy Production Code
      uses: jbrooksuk/[email protected]
      with:
        trigger_url: ${{ secrets.MAIN_TRIGGER }}

Let me know if there's anything else you need to investigate the issue.

Action Sends Response Before Complete

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/[email protected]
      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

Deploy via API fails

Hey there!

I'm unable to get your Deploy via API example working. I'm not sure if something has changed in Forge, but the Deployment Trigger URL example works perfectly fine. Any ideas on why it might be failing? All secrets have been created for testing, and it looks like the job is grabbing them properly. Error thrown is:

curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.