{"id":13394123,"url":"https://github.com/primer/deploy","last_synced_at":"2025-03-13T20:31:23.335Z","repository":{"id":65988748,"uuid":"168287769","full_name":"primer/deploy","owner":"primer","description":"Deploy to Now from GitHub Actions with useful aliases","archived":true,"fork":false,"pushed_at":"2019-07-23T20:53:20.000Z","size":124,"stargazers_count":45,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-17T04:25:32.021Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npm.im/@primer/deploy","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/primer.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-30T05:58:11.000Z","updated_at":"2023-01-28T15:15:11.000Z","dependencies_parsed_at":"2023-05-21T11:45:30.166Z","dependency_job_id":null,"html_url":"https://github.com/primer/deploy","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primer%2Fdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primer%2Fdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primer%2Fdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primer%2Fdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primer","download_url":"https://codeload.github.com/primer/deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478068,"owners_count":20297187,"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-07-30T17:01:09.702Z","updated_at":"2025-03-13T20:31:22.986Z","avatar_url":"https://github.com/primer.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# primer/deploy\n\nThis [GitHub Action][github actions] deploys to [Now] and aliases the successful deployment to a predictable URL according to the following conditions:\n\n1. We run `now` without any arguments to get the \"root\" deployment URL, which is generated by Now.\n1. If the branch is `master`, we treat the `alias` field in `now.json` as the production URL and:\n    1. If there is a `rules.json`:\n        * `now alias \u003cdeployment\u003e \u003cname\u003e.now.sh` to create a fallback URL for path aliases\n        * `now alias \u003cdeployment\u003e \u003cproduction\u003e -r rules.json` to set up path aliases\n    1. `now alias \u003cdeployment\u003e \u003cproduction\u003e` to alias the production URL.\n1. `now alias \u003cdeployment\u003e \u003cname\u003e-\u003cbranch\u003e.now.sh` to alias the root deployment to a branch-specific URL.\n\nThe app name (`\u003cname\u003e`) and branch (`\u003cbranch\u003e`) are both \"slugified\" to strip invalid characters so that they'll work as URLs. Leading non-word characters are removed, and any sequence of characters that isn't alphanumeric or `-` is replaced with a single `-`. In other words, `@primer/css` becomes `primer-css`, `shawnbot/some_branch` becomes `shawnbot-some-branch`, and so on.\n\n## Status checks\nTwo [status checks] will be listed for this action in your checks: **deploy** is the action's check, and **deploy/alias** is a [commit status] created by the action that reports the URL and links to it via \"Details\":\n\n![image](https://user-images.githubusercontent.com/113896/52000881-f8c45980-2472-11e9-8d04-00264094437b.png)\n\n**Note:** Checks listed in the PR merge box (above) always point to the most recent commit, but you can access the list of [checks][status checks] for the last commit of every push by clicking on the status icon (usually a ![green check](https://user-images.githubusercontent.com/113896/52001573-99674900-2474-11e9-82ab-6414e3f004cf.png) or ![red x](https://user-images.githubusercontent.com/113896/52001543-88b6d300-2474-11e9-84ca-82ff51828ea9.png)) in your repo's \"Commits\" and \"Branches\" pages, or commit history on a PR page:\n\n![image](https://user-images.githubusercontent.com/113896/52001489-64f38d00-2474-11e9-92ea-827e466eb948.png)\n\n## Usage\nTo use this action in your own workflow, add the following snippet to your `.github/main.workflow` file:\n\n```hcl\naction \"deploy\" {\n  uses = \"primer/deploy@master\"\n  secrets = [\n    \"GITHUB_TOKEN\",\n    \"NOW_TOKEN\",\n  ]\n}\n```\n\n**You will need to provide a [Zeit token](https://zeit.co/account/tokens) value for the `NOW_TOKEN` secret in the Actions visual editor** if you haven't already.\n\nTo avoid racking up failed deployments, we suggest that you place this action after any linting and test actions.\n\n## Now CLI arguments\nIt's possible to pass additional arguments through to the `now` CLI via the `args` field in your workflow action. Because the `primer-deploy` CLI accepts options of its own (such as `--dry-run`), you need to prefix any `now` arguments with `--`:\n\n```diff\naction \"deploy\" {\n  uses = \"primer/deploy@master\"\n+  args = \"-- --meta autoDeployed=true\"\n```\n\nYou can also use `args` to deploy a subdirectory, e.g. `docs`:\n\n```diff\naction \"deploy\" {\n  uses = \"primer/deploy@master\"\n+  args = \"-- docs\"\n```\n\n\n[now]: https://zeit.co/now\n[github actions]: https://github.com/features/actions\n[commit status]: https://developer.github.com/v3/repos/statuses/\n[status checks]: https://help.github.com/articles/about-status-checks/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimer%2Fdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimer%2Fdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimer%2Fdeploy/lists"}