{"id":22083787,"url":"https://github.com/unlyed/github-action-deploy-on-vercel","last_synced_at":"2025-07-24T16:31:11.735Z","repository":{"id":42473792,"uuid":"340066784","full_name":"UnlyEd/github-action-deploy-on-vercel","owner":"UnlyEd","description":"Deploy to Vercel using a custom command, returns the deployment url","archived":false,"fork":false,"pushed_at":"2023-04-24T07:57:45.000Z","size":30328,"stargazers_count":8,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T09:48:41.693Z","etag":null,"topics":["deploy","deployment","gha","github-actions","vercel"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/deploy-on-vercel","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/UnlyEd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"liberapay":"unlyEd"}},"created_at":"2021-02-18T13:58:18.000Z","updated_at":"2024-01-18T13:25:09.000Z","dependencies_parsed_at":"2024-11-21T06:46:41.198Z","dependency_job_id":null,"html_url":"https://github.com/UnlyEd/github-action-deploy-on-vercel","commit_stats":{"total_commits":49,"total_committers":4,"mean_commits":12.25,"dds":"0.34693877551020413","last_synced_commit":"ea5e2f93e779a4964fd0dbed1fbcf3e332be2f34"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fgithub-action-deploy-on-vercel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fgithub-action-deploy-on-vercel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fgithub-action-deploy-on-vercel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnlyEd%2Fgithub-action-deploy-on-vercel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnlyEd","download_url":"https://codeload.github.com/UnlyEd/github-action-deploy-on-vercel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227457126,"owners_count":17777944,"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":["deploy","deployment","gha","github-actions","vercel"],"created_at":"2024-12-01T00:17:40.139Z","updated_at":"2024-12-01T00:17:40.855Z","avatar_url":"https://github.com/UnlyEd.png","language":"JavaScript","funding_links":["https://liberapay.com/unlyEd"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://unly.org\"\u003e\u003cimg src=\"https://storage.googleapis.com/unly/images/ICON_UNLY.png\" align=\"right\" height=\"20\" alt=\"Unly logo\" title=\"Unly logo\" /\u003e\u003c/a\u003e\n[![Maintainability](https://api.codeclimate.com/v1/badges/97a6022a22be785dd2ea/maintainability)](https://codeclimate.com/github/UnlyEd/github-action-deploy-on-vercel/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/97a6022a22be785dd2ea/test_coverage)](https://codeclimate.com/github/UnlyEd/github-action-deploy-on-vercel/test_coverage)\n\n![GitHub Action integration test](https://github.com/UnlyEd/github-action-deploy-on-vercel/workflows/GitHub%20Action%20integration%20test/badge.svg)\n![GitHub Action build test](https://github.com/UnlyEd/github-action-deploy-on-vercel/workflows/GitHub%20Action%20build%20test/badge.svg)\n![Update Code Climate test coverage](https://github.com/UnlyEd/github-action-deploy-on-vercel/workflows/Update%20Code%20Climate%20test%20coverage/badge.svg)\n\n# GitHub Action - Deploy on Vercel (using a custom command)\n\n## Code snippet example (minimal example)\n\n```yaml\nname: 'GitHub Action code snippet'\non:\n  pull_request:\n  push:\n    branches:\n      - '*'\n\njobs:\n  run-example-deployment:\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: actions/checkout@v3\n      - uses: UnlyEd/github-action-deploy-on-vercel@latest\n        with:\n          command: \"vercel examples/static-deployment --confirm --debug --token ${{ secrets.VERCEL_TOKEN }}\"\n        env:\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n\n      - run: \"echo \\\"Found deployment url: ${{ env.VERCEL_DEPLOYMENT_URL }}\\\"\"\n```\n\n\u003e [Source](https://github.com/UnlyEd/github-action-deploy-on-vercel/blob/review/.github/workflows/run-example-deployment.yml)\n\n## What does this GitHub Action do?\n\nYou can use this action to deploy a Vercel project online through a GitHub action.\n\nThe action will return the url of the Vercel deployment _(and store it as environment variable, too)_, it will also apply domain aliases if there are any configured in the Vercel config file (`vercel.config` by default).\n\n## Differences between `github-action-deploy-on-vercel` and `vercel-action`\n\nThis action works quite differently compared to [`vercel-action`](https://github.com/marketplace/actions/vercel-action).\n\n\u003e TL;DR: `vercel-action` is great if you don't need a lot of flexibility over the `vercel deploy` command.\n\u003e `github-action-deploy-on-vercel` is great if you need to run a custom command, such as a `npm/yarn` script.\n\n`vercel-action` hides the `vercel deploy` command from you, and acts as a wrapper by providing its own API on top of it.\n\nThey simplify the `vercel` command by doing so. Unfortunately, they also reduce the flexibility available to the consumer (you).\n\nIn our case, we are dealing with multiple customers (B2B) which are **all sharing the same code base**. \nThe `vercel-action` was too limited and would have complicated our setup, because it requires additional information such as `project_id`/`org_id`.\n\nFor most project, we believe using `vercel-action` is enough, and we encourage you to use it, if you don't need to run a special `vercel deploy` command.\n\n## Why/when should you use it?\n\nYou want to run a custom command that (amongst other things) performs a Vercel deployment and returns the URL of the Vercel deployment.\n\nThe URL of the deployment is often necessary to run follow-up actions, such as:\n- Running End-to-End tests on the deployed site\n- Running LightHouse tests on the deployed site\n- Etc.\n\n### Action's API\n\n#### Inputs\n\nName | Required | Default | Description\n---  | --- |--- |---\n`command`|✅| | Command starting the vercel deployment\n`applyDomainAliases`|✖️|`true`| If true, will create Vercel aliases using the aliases specified in the vercel config file\n`failIfAliasNotLinked`|✖️|`false`| If true, will throw an error (and crash CI) when there is an error about aliases link\n`extraAliases`|✖️|``| String of domain aliases, split by `, `. Will be merged with the `vercel.json:aliases`. Can be used to [dynamically alias the current branch](#example-with-dynamic-aliases-based-on-github-branch-on-push-event).\n\n#### Outputs\n\nThe below variables are available as outputs, but are also **injected as environment variables automatically**.\n\n- `VERCEL_DEPLOYMENT_URL`: Full Vercel deployment url (parsed from the deployment logs), e.g: `https://xxx.vercel.app`\n- `VERCEL_DEPLOYMENT_DOMAIN`: Url without the protocol declaration, e.g: `xxx.vercel.app`\n- `VERCEL_ALIASES_ERROR`: _(optional)_ Vercel errors during domain aliasing\n- `VERCEL_ALIASES_CREATED`: List of aliases created successfully, as a string separated by `, ` for each alias\n- `VERCEL_ALIASES_CREATED_COUNT`: Number of created aliases\n- `VERCEL_ALIASES_CREATED_FULL`: List of aliases created successfully, as a JSON array containing the Vercel's response \n- `VERCEL_ALIASES_CREATED_URLS_MD`: List of aliases created successfully, as a Markdown string separated by `, ` for each alias\n- `VERCEL_ALIASES_FAILED_COUNT`: Number of aliases that failed to be created\n- `VERCEL_ALIASES_FAILED_FULL`: List of aliases that failed, as a JSON array containing the Vercel's response \n\u003e Hint: You can use `${{ env.VERCEL_DEPLOYMENT_URL }}` in you GitHub Action to read the deployment URL, after the action has run.\n\n## Advanced examples\n\n### Example with dynamic aliases based on GitHub branch (on `push` event)\n\n```yml\nname: 'GitHub Action deploy example'\non:\n  pull_request:\n  push:\n    branches:\n      - '*'\n\njobs:\n  run-example-deployment:\n    runs-on: ubuntu-22.04\n    steps:\n      - uses: actions/checkout@v3\n\n      # Extracts GitHub metadata (branch name, etc.)\n      - name: Expose GitHub slug/short variables # See https://github.com/rlespinasse/github-slug-action#exposed-github-environment-variables\n        uses: rlespinasse/github-slug-action@v3.x # See https://github.com/rlespinasse/github-slug-action\n\n      - uses: ./\n        with:\n          # Deploys examples/static-deployment\n          command: \"yarn deploy:example --token ${{ secrets.VERCEL_TOKEN }}\"\n          applyDomainAliases: true\n          failIfAliasNotLinked: false\n          # Uses dynamically resolved additional aliases (e.g: one based on the current branch's name)\n          # Uses alias that's longer than 63 chars to check if it gets shortened, because of RFC 1035 - See https://vercel.com/support/articles/why-is-my-vercel-deployment-url-being-shortened?query=url%20length#rfc-1035\n          #  github-action-deploy-on-vercel-example-extra-alias-test-limit-alias-length.vercel.app \u003e github-action-deploy-on-vercel-example-extra-alias-test-limit-a.vercel.app (shortened)\n          # TODO Don't always use GITHUB_REF_SLUG (push) but GITHUB_HEAD_REF_SLUG when event is pull_request - See https://github.com/rlespinasse/github-slug-action/issues/71\n          extraAliases: \u003e-\n            github-action-deploy-on-vercel-example-${{ env.GITHUB_REF_SLUG }}.vercel.app\n\n        env:\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n\n      - run: \"echo \\\"Found deployment url: ${{ env.VERCEL_DEPLOYMENT_URL }}\\\"\"\n      - run: \"echo \\\"Created ${{ env.VERCEL_ALIASES_CREATED_COUNT }} aliases\\\"\"\n      - run: \"echo \\\"Created aliases: ${{ env.VERCEL_ALIASES_CREATED }}\\\"\"\n      - run: \"echo \\\"Created aliases (full): ${{ env.VERCEL_ALIASES_CREATED_FULL }}\\\"\"\n      - run: \"echo \\\"Alias markdown generated: ${{ env.VERCEL_ALIASES_CREATED_URLS_MD }}\\\"\"\n      - run: \"echo \\\"Failed ${{ env.VERCEL_ALIASES_FAILED_COUNT }} aliases\\\"\"\n      - run: \"echo \\\"Failed aliases (full): ${{ env.VERCEL_ALIASES_FAILED_FULL }}\\\"\"\n```\n\n\n## :hugs: Community examples :heart:\n\nHere are a few community-powered examples, those are usually advanced use-cases!\n\n- [Next Right Now](https://github.com/UnlyEd/next-right-now) _(Disclosure: We're the author!)_\n  - [PR](https://github.com/UnlyEd/next-right-now/pull/296) - \"Using this action helped us reduce a lot of **bash** code which was hardly testable.\" - _Next Right Now core contributors_\n\n---\n\n# Advanced debugging\n\n\u003e Learn how to enable logging, from within the `github-action-store-variable` action.\n\n## How to enable debug logs\n\nOur GitHub Action is written using the GitHub Actions\nnative [`core.debug` API](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs).\n\nTherefore, it allows you to enable logging whenever you need to debug **what's happening within our action**.\n\n**To enable debug mode**, you have to set a [**GitHub Secret**](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets), such as:\n\n- `ACTIONS_STEP_DEBUG` of value `true`\n\nPlease see [the official documentation](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#how-to-access-step-debug-logs) for more information.\n\n\u003e Enabling debugging using `ACTIONS_STEP_DEBUG` will also enable debugging for all other GitHub Actions you use that are using the `core.debug` API.\n\n---\n\n# Contributing\n\nWe gladly accept PRs, but please open an issue first, so we can discuss it beforehand.\n\n---\n\n# Changelog\n\n[Changelog](./CHANGELOG.md)\n\n---\n\n# Releases versioning\n\nWe follow Semantic Versioning. (`major.minor.patch`)\n\nOur versioning process is completely automated, any changes landing on the `main` branch will trigger a new [release](../../releases).\n\n- `MAJOR`: Behavioral change of the existing API that would result in a breaking change.\n  - E.g: Removing an input, or changing the output would result in a breaking change and thus would be released as a new MAJOR version.\n- `Minor`: Behavioral change of the existing API that would **not** result in a breaking change.\n  - E.g: Adding an optional input would result in a non-breaking change and thus would be released as a new Minor version.\n- `Patch`: Any other change.\n  - E.g: Documentation, tests, refactoring, bug fix, etc.\n\n## Release versions\n\nThe examples above use an auto-updated major version tag (`@v1`).\nIt is also possible to use the `@latest` tag.  (RC stands for \"Release candidate\", which is similar to a Beta version)\n\nWhile those options can be useful, we intend to give some \"production-grade\" best practices.\n\n- **Do NOT use `@latest` for production**, ever. While only \"supposed-to-be-stable\" versions will be tagged\n  as `@latest`, it could harbor bugs nonetheless.\n- You can use auto-upgrading major version, such as `@v1` or `@v1.2`, but this is not always the best practice, see our\n  explanations below.\n\n### Special tags and best practices for production-grade apps\n\nHere are a few useful options you can use to pin a more-or-less specific version of our GitHub Action, alongside some \"\nproduction-grade\" best practices.\n\n- `@{COMMIT-SHA}`, e.g: `@1271dc3fc4c4c8bc62ba5a4e248dac95cb82d0e3`, recommended for all production-grade apps, it's the\n  only truly safe way to pinpoint a version that cannot change against your will (**SAFEST**)\n- `@{MAJOR}-{MINOR}-{PATCH}`, e.g: `@v1.2.31`, while not as safe as the `COMMIT-SHA` way, it's what most people use (\n  SAFER)\n- `@{MAJOR}`, e.g: `@v1`, can be used on production, but we do not advise to do so (SAFE-ISH)\n- `@{MAJOR}-rc`, e.g: `@v1-rc`, **reserved for development mode**, useful when debugging on a specific prerelease\n  version (UNSAFE)\n- `@{MAJOR}.{MINOR}`, e.g: `@v1.2`, can be used on production, but we do not advise to do so (SAFE-ISH)\n- `@{MAJOR}.{MINOR}-rc`, e.g: `@v1.2-rc`, **reserved for development mode**, useful when debugging on a specific\n  prerelease\n  version (UNSAFE)\n- `@latest`, **reserved for development mode**, useful when debugging (UNSAFE)\n\n**\"But, what is the issue with the `@{MAJOR}-{MINOR}-{PATCH}` way to pin a specific version\"?**\n\n\u003e Well, if this repository gets hacked by a 3rd party, **they can easily change all Git tags to a different commit**,\nwhich could contain malicious code.\n\nThat's why **pinning a specific commit SHA is the only truly safe option**. This way, the code you're using **cannot be\nchanged against your will**.\n\nMost people won't care about this and will use a MAJOR version tag instead anyway, such as `@v1`. It's common, but not\noften the best practice.\n\nIt all comes down to the risks you're ready to take, and it's up to you to decide what's best in your situation.\n\n---\n\n# License\n\n[MIT](./LICENSE)\n\n---\n\n# Vulnerability disclosure\n\n[See our policy](https://github.com/UnlyEd/Unly).\n\n---\n\n# Contributors and maintainers\n\nThis project is being authored by:\n\n- [Unly] Ambroise Dhenain ([Vadorequest](https://github.com/vadorequest)) **(active)**\n- Hugo Martin ([Demmonius](https://github.com/demmonius)) **(active)**\n\n---\n\n# **[ABOUT UNLY]** \u003ca href=\"https://unly.org\"\u003e\u003cimg src=\"https://storage.googleapis.com/unly/images/ICON_UNLY.png\" height=\"40\" align=\"right\" alt=\"Unly logo\" title=\"Unly logo\" /\u003e\u003c/a\u003e\n\n\u003e [Unly](https://unly.org) is a socially responsible company, fighting inequality and facilitating access to higher education.\n\u003e Unly is committed to making education more inclusive, through responsible funding for students.\n\nWe provide technological solutions to help students find the necessary funding for their studies.\n\nWe proudly participate in many TechForGood initiatives. To support and learn more about our actions to make education accessible, visit :\n\n- https://twitter.com/UnlyEd\n- https://www.facebook.com/UnlyEd/\n- https://www.linkedin.com/company/unly\n- [Interested to work with us?](https://jobs.zenploy.io/unly/about)\n\nTech tips and tricks from our CTO on our [Medium page](https://medium.com/unly-org/tech/home)!\n\n# TECHFORGOOD #EDUCATIONFORALL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlyed%2Fgithub-action-deploy-on-vercel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlyed%2Fgithub-action-deploy-on-vercel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlyed%2Fgithub-action-deploy-on-vercel/lists"}