{"id":44960325,"url":"https://github.com/the-trybe/forge-deployment-scripts","last_synced_at":"2026-02-18T13:03:18.280Z","repository":{"id":258166128,"uuid":"861226148","full_name":"the-trybe/forge-deployment-scripts","owner":"the-trybe","description":"Opinionated github action to create/update and deploy sites on Laravel Forge using a yaml config file.","archived":false,"fork":false,"pushed_at":"2025-11-03T09:54:29.000Z","size":248,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-03T11:27:20.896Z","etag":null,"topics":["cicd","deployment","deployment-automation","devops","laravel","laravel-forge","open-source"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the-trybe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-22T10:52:01.000Z","updated_at":"2025-07-09T15:52:15.000Z","dependencies_parsed_at":"2025-07-09T16:50:10.203Z","dependency_job_id":null,"html_url":"https://github.com/the-trybe/forge-deployment-scripts","commit_stats":null,"previous_names":["the-trybe/forge-deployment-scripts"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/the-trybe/forge-deployment-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-trybe%2Fforge-deployment-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-trybe%2Fforge-deployment-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-trybe%2Fforge-deployment-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-trybe%2Fforge-deployment-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the-trybe","download_url":"https://codeload.github.com/the-trybe/forge-deployment-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the-trybe%2Fforge-deployment-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29580647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cicd","deployment","deployment-automation","devops","laravel","laravel-forge","open-source"],"created_at":"2026-02-18T13:03:17.669Z","updated_at":"2026-02-18T13:03:18.275Z","avatar_url":"https://github.com/the-trybe.png","language":"Python","readme":"This repository is archived and no longer maintained.\n\nActive development has moved to: [the-trybe/deploy-to-laravel-forge](https://github.com/the-trybe/deploy-to-laravel-forge)\n\n---\n\n# Deploy to Laravel Forge GitHub Action\n\nThis GitHub Action simplifies site creation, configuration, and deployment using a YAML configuration file.\n\n## Key Features\n\n- **Version-Controlled Site Configurations:** Manage and track your site configurations in a YAML file within your repository. This ensures that your sites configuration is versioned along with your application code, providing consistency across environments.\n- **Automated Deployment:** Deploy multiple sites to Laravel Forge automatically using github actions.\n- **Customizable Configurations:** Configure all aspects of your Laravel Forge sites, such as environment variables, deployment script, Nginx configurations, PHP versions, daemons, and SSL certificates, directly from the YAML file.\n- **Secret Management:** Securely manage environment variables and secrets via GitHub Secrets or external secret management tools like 1Password. Secrets are easily replaced within the YAML configuration for safe deployment.\n\n## Inputs\n\n- `forge_api_token` (required): Laravel Forge API Token.\n- `deployment_file` (optional): The deployment configuration file (default: `forge-deploy.yml`).\n- `debug` (optional): Enable debug mode in logs (default: `false`).\n- `secrets` (optional): Secrets to replace in the `forge-deploy.yml` file. The value should be a multi-line string with the format `VAR_NAME=VALUE`.\n\n## Usage\n\nTo use this action, create a workflow file (e.g., `.github/workflows/deploy.yml`) in your repository with the following content:\n\n```yaml\nname: Deploy to Laravel Forge\n\non:\n  push:\n    branches:\n      - main # Adjust to the branch that should trigger the deployment\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout the repository # required\n        uses: actions/checkout@v4\n\n      - name: Deploy to Laravel Forge\n        uses: the-trybe/forge-deployment-scripts@v1\n        with:\n          forge_api_token: ${{ secrets.FORGE_API_TOKEN }}\n          deployment_file: forge-deploy.yml # [Optional] The deployment configuration file (default: forge-deploy.yml).\n          debug: false # [Optional] Enable debug mode in logs (default: false).\n          secrets:\n            | # [Optional] Secrets to replace in the forge-deploy.yml file. EX:\n            DB_PASSWORD=${{ secrets.DB_PASSWORD }}\n            DB_USER=${{ secrets.DB_USER }}\n```\n\nyour repository should have a `forge-deploy.yml` file in the root of the repo.\n\n```yaml\n# forge-deploy.yml schema\n\n# Server configuration\nserver_name: \"my-server\" # [Required] The name of your Laravel Forge server.\ngithub_repository: \"user/my-repo\" # [Required] The GitHub repository for your site (format: user/repo).\ngithub_branch: \"main\" # [Optional] The branch to deploy (default: \"main\").\n\n# Sites Configuration - list of sites to configure and deploy\nsites:\n  - site_domain: \"mywebsite.com\" # [Required] The primary domain for the site.\n    github_branch: \"another-branch\" #[Optional] site level branch config, if not set global branch is used.\n    root_dir: \"/client\" # [Optional] The root directory relative to the repo root (default: \"/\").\n    web_dir: \"/public\" # [Optional] The web directory (default: \"/public\").\n    project_type: \"php\" # [Optional] The type of the project (\"php\" for Laravel projects, for other types don't include).\n    php_version: \"php81\" # [Optional] PHP version to use (if not installed in the server, it will be installed).\n    deployment_commands:\n      | # [Optional] deployment commands to execute during deployment (if not included forge default will be used).\n      composer install --no-interaction --prefer-dist --optimize-autoloader\n      php artisan migrate --force\n    env_file: \".env\" # [Optional] The environment file to use (relative to the root of the repository)\n    environment:\n      | # [Optional] Environment variables, if both env_file and environment are provided, both will be used (environment will have precedence).\n      APP_ENV=\"production\"\n      DB_CONNECTION=\"mysql\"\n      DB_HOST=\"127.0.0.1\"\n      DB_PORT=3306\n      DB_DATABASE=\"mywebsite_db\"\n      DB_USERNAME=${{secrets.DB_USER}} # replacing secrets only works in the yaml file and not in external env files.\n      DB_PASSWORD=${{secrets.DB_PASSWORD}}\n    aliases: # [Optional] Additional domain aliases.\n      - \"www.mywebsite.com\"\n    nginx_template: \"default\" # [Optional] Nginx template to use from `nignx_templates` folder (default: \"default\").\n    nginx_template_variables: # [Optional] Variables to replace in the Nginx template.\n      PROXY_PASS_PORT: 8080\n    nginx_custom_config: \"path/to/nginx.conf\" # [Optional] Custom Nginx config file relative to the repository root.\n    certificate: true # [Optional] Boolean to enable or disable SSL certificate for this domain (default: false).\n    clone_repository: true # [Optional] Boolean to clone the repository (default: true).\n    laravel_scheduler: true # [Optional] Boolean to enable Laravel scheduler (default: false).\n    daemons: # [Optional] List of daemons or processes to run in the background.\n      - command: \"php artisan queue:work\"\n      - command: \"php artisan schedule:run\"\n\n  - site_domain: \"myotherwebsite.com\"\n    root_dir: \"/public_html\" # Specify a different root directory.\n    deployment_commands: |\n      npm install\n      npm run build\n    environment: | # Example of a different environment configuration.\n      API_URL=\"https://api.myotherwebsite.com\"\n      FEATURE_FLAG=\"enabled\"\n    nginx_template: \"custom_template\" # Custom Nginx template from the nginx_templates folder.\n    nginx_template_variables:\n      UPSTREAM_SERVER: \"127.0.0.1\"\n      UPSTREAM_PORT: 8081\n    certificate: false # SSL certificate disabled for this site.\n    daemons: # Custom daemons for this site.\n      - command: \"node server.js\"\n\n  - site_domain: \"api.mywebsite.com\" # Example of an API-specific site.\n    deployment_commands: |\n      npm ci\n      npm run build\n    environment: |\n      NODE_ENV=\"production\"\n      API_KEY=\"12345\"\n      DB_CONNECTION=\"postgres\"\n      DB_HOST=\"localhost\"\n      DB_PORT=5432\n      DB_USER=\"api_user\"\n      DB_PASSWORD=\"apipassword\"\n    nginx_template: \"reverse-proxy\"\n    nginx_template_variables:\n      PROXY_PASS_PORT: 3000\n    certificate: true\n    daemons:\n      - command: \"pm2 start dist/server.js --name api-server\"\n```\n\nAdditional Configuration Options and Customization:\n\n1. `root_dir` field: Specify the root directory relative to the repository root for each site.\n\n2. `project_type` field: set to \"php\" if the project is a Laravel project, otherwise, don't include this field.\n\n3. `php_version` field: Specify the PHP version to use (e.g., \"php81\", \"php82\"), if the version is not installed on the server it will get installed.\n\n4. `deployment_commands` field: Commands to run during the deployment process. Useful for setting up the environment, building assets, or running migrations.\n\n5. `environment` field: Environment variables specific to each site.\n\n6. `nginx_template` field: Specify a custom Nginx template for each site (see the `nginx_templates` folder). you can add additional templates by creating a file in the `nginx_templates` folder.\n\n7. `nginx_template_variables` field: Variables to replace in the Nginx template. variables should be in the template file as `{{ VARIABLE_NAME }}`, avoid using forge [reserved variables](https://forge.laravel.com/docs/servers/nginx-templates.html#template-variables).\n\n8. `daemons` field: List of processes to run as daemons (e.g., queue workers, Node.js servers).\n\n9. You can add multiple sites in the `sites` array, each with its own configuration. Each site will be configured separately on the Laravel Forge server.\n\n10. You can add secrets to the `forge-deploy.yml` file in the form `${{ secrets.SECRET_VAR }}`. These secrets will be replaced by the values provided in the `secrets` input of the GitHub Action.\n\n## Additional Examples\n\n### Load secrets using One Password\n\n```yaml\nname: Deploy to Laravel Forge\n\non:\n  workflow_dispatch:\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout the repository\n        uses: actions/checkout@v4\n\n      - name: Load secret\n        uses: 1password/load-secrets-action@v2\n        with:\n          export-env: true\n        env:\n          OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}\n          DB_USER: op://vault-name/db/user\n          DB_PASSWORD: op://vault-name/db/password\n\n      - name: Deploy to Laravel Forge\n        uses: the-trybe/forge-deployment-scripts@main\n        with:\n          forge_api_token: ${{ secrets.FORGE_API_TOKEN }}\n          # in secrets use 'env.' instead of 'secrets.'\n          secrets: |\n            DB_USER=${{ env.DB_USER }}\n            DB_PASSWORD=${{ env.DB_PASSWORD }}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-trybe%2Fforge-deployment-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe-trybe%2Fforge-deployment-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe-trybe%2Fforge-deployment-scripts/lists"}