This action triggers the deployment of a Laravel Forge site. It can optionally update the site's .env file and deployment script prior to triggering the deployment.
Add the following entry to your Github workflow YAML file with the required inputs:
uses: PropFuel/laravel-forge-deploy-action@v1.0.1
with:
  forge-api-token: your-forge-api-token
  forge-server-id: your-forge-server-id
  forge-site-id: your-forge-site-idWe recommend storing sensitive data as GitHub encrypted secrets.
| Input | Description | 
|---|---|
| forge-api-token | Your Forge API Token. This can be generated in your Account Settings. | 
| forge-server-id | Your Forge Server ID. | 
| forge-site-id | Your Forge Site ID. | 
| Input | Description | 
|---|---|
| env-file-path | Relative path to the file whose content will replace your site's .envfile. | 
| deploy-script-path | Relative path to the file whose content will replace your site's deployment script. | 
Trigger your site's deployment:
name: Deploy on push to main branch
on:
  push:
    branches:
      - main
jobs:
  deploy:
    name: Laravel Forge Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Deploy
        uses: PropFuel/laravel-forge-deploy-action@v1.0.1
        with:
          forge-api-token: ${{ secrets.FORGE_API_TOKEN }}
          forge-server-id: ${{ secrets.FORGE_SERVER_ID }}
          forge-site-id: ${{ secrets.FORGE_SITE_ID }}Use a matrix to update the .env file, the deployment script, and trigger the deployment of multiple sites:
name: Deploy multiple sites
on:
  push:
    branches:
      - main
jobs:
  deploy:
    name: Laravel Forge Deploy
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - serverId: server-1-id
            siteId: site-1-id
          - serverId: server-2-id
            siteId: site-2-id
    steps:
      - name: Checkout the repo
        uses: actions/checkout@v3
      - name: Write a .env file to the current workspace
        run: |
          echo "PROP=fuel" >> .env
          echo "FOO=bar" >> .env
      - name: Deploy
        uses: PropFuel/laravel-forge-deploy-action@v1.0.1
        with:
          forge-api-token: ${{ secrets.FORGE_API_TOKEN }}
          forge-server-id: ${{ matrix.serverId }}
          forge-site-id: ${{ matrix.siteId }}
          env-file-path: .env
          deploy-script-path: path/in/repo/to/deploy.sh