{"id":15691549,"url":"https://github.com/onekiloparsec/heroku-node-deploy-subfolder","last_synced_at":"2025-10-09T06:33:40.948Z","repository":{"id":41328326,"uuid":"266307903","full_name":"onekiloparsec/heroku-node-deploy-subfolder","owner":"onekiloparsec","description":"Deploy to Heroku through git a Node.js project built into a subfolder","archived":false,"fork":false,"pushed_at":"2022-08-18T19:28:18.000Z","size":50,"stargazers_count":8,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T02:04:26.931Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onekiloparsec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-23T09:53:29.000Z","updated_at":"2022-06-30T15:48:03.000Z","dependencies_parsed_at":"2022-08-20T09:40:13.313Z","dependency_job_id":null,"html_url":"https://github.com/onekiloparsec/heroku-node-deploy-subfolder","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Fheroku-node-deploy-subfolder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Fheroku-node-deploy-subfolder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Fheroku-node-deploy-subfolder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onekiloparsec%2Fheroku-node-deploy-subfolder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onekiloparsec","download_url":"https://codeload.github.com/onekiloparsec/heroku-node-deploy-subfolder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978754,"owners_count":21834915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-03T18:22:14.587Z","updated_at":"2025-10-09T06:33:35.910Z","avatar_url":"https://github.com/onekiloparsec.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heroku Node.js Deploy Subfolder\n\n![GitHub issues](https://img.shields.io/github/issues/onekiloparsec/heroku-node-deploy-subfolder.svg)\n![GitHub](https://img.shields.io/github/license/onekiloparsec/heroku-node-deploy-subfolder.svg)\n\nThis is a simple GitHub action that allows you to deploy a Node.js project to Heroku. It is a slightly simpler, more focused, and safer fork from [AkhileshNS/heroku-deploy](https://github.com/AkhileshNS/heroku-deploy).\n\nIt is focused on doing only one thing: deploy through `git` (not Docker) a Node.js project built inside a subfolder (e.g. `dist`). It uses `git subtree split` to achieve that. Note that you must specify all parameters. The Heroku process is the `web` one, obviously.\n\nThe  `bash/git` command executed is the following (assuming the `heroku` remote has been sucessfully set):\n\n```\ngit push heroku \\`git subtree split --prefix ${subfolder} HEAD\\`:${heroku_branch} --force\"\"\n```\n\nNote that:\n* We **do not** double-check for the correct branch anymore (we used to do it), because this is something that the CI file must take care of.\n* We always use `--force` to ensure the push is always working, even if in the meantime some manual deploy have been triggered from another place.\n\n# Usage\n\nIn order to use the action in your workflow, just add in your _.github/workflows/YOURACTION.yml_ and fill the `with` parameters. **Make sure your `dist` subfolder is commited (otherwise the `git subtree split` won't detect any change).**\n\n# Example\n\nBelow is an example with two build-and-deploy files, one using staging and one for prod.\n\n```yaml\nname: my-awesome-actions-jobs-staging\n\non:\n  push:\n    branches:\n      - develop\n      \njobs:\n  deploy-staging:\n    runs-on: ubuntu-latest\n    needs: test-unit\n    if: github.ref == 'refs/heads/develop'\n    steps:\n      - uses: actions/checkout@v2\n      # possibly setup node action here...\n      # possibly cache of node modules action here...\n      # build steps here...\n      - uses: onekiloparsec/heroku-node-deploy-subfolder@v1.1.0\n        with:\n          api_key: ${{secrets.HEROKU_API_KEY}}\n          email: ${{secrets.HEROKU_EMAIL}}\n          app_name: \u003cAPP_NAME_STAGING\u003e\n          heroku_branch: \"master\"\n          subfolder: \"dist-staging\"\n```\n\n```yaml\nname: my-awesome-actions-jobs-prod\n\non:\n  push:\n    branches:\n      - master\n      \njobs:\n  deploy-prod:\n    runs-on: ubuntu-latest\n    needs: test-unit\n    if: github.ref == 'refs/heads/master'\n    steps:\n      - uses: actions/checkout@v2\n      # possibly setup node action here...\n      # possibly cache of node modules action here...\n      # build steps here...\n      - uses: onekiloparsec/heroku-node-deploy-subfolder@v1.1.0\n        with:\n          api_key: ${{secrets.HEROKU_API_KEY}}\n          email: ${{secrets.HEROKU_EMAIL}}\n          app_name: \u003cAPP_NAME_PROD\u003e\n          heroku_branch: \"master\"\n          subfolder: \"dist-prod\"\n```\n\n# License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/onekiloparsec/heroku-node-deploy-subfolder/blob/master/LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonekiloparsec%2Fheroku-node-deploy-subfolder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonekiloparsec%2Fheroku-node-deploy-subfolder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonekiloparsec%2Fheroku-node-deploy-subfolder/lists"}