https://github.com/process-analytics/surge.sh-pa-admin
Manage the surge.sh domains of the Process Analytics project
https://github.com/process-analytics/surge.sh-pa-admin
surge-sh
Last synced: about 1 month ago
JSON representation
Manage the surge.sh domains of the Process Analytics project
- Host: GitHub
- URL: https://github.com/process-analytics/surge.sh-pa-admin
- Owner: process-analytics
- License: apache-2.0
- Created: 2023-07-11T05:22:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-22T16:52:55.000Z (about 1 year ago)
- Last Synced: 2025-01-22T17:37:21.334Z (about 1 year ago)
- Topics: surge-sh
- Homepage:
- Size: 89.8 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# surge.sh-pa-admin
Manage the surge.sh domains of the Process Analytics project.
## Available workflows
Workflows are used to manage surge.sh domains specific to the Process Analytics project.
- [List all domains](.github/workflows/surge-list-domains.yml): get the list of all active domains
- [Teardown a domain](.github/workflows/surge-teardown-domain.yml): delete a domain
- [Teardown old domains](.github/workflows/surge-teardown-old-domains.yml): periodically delete domains older than one month (inactive PRs, domains not automatically closed when the PR is closed)
## Patching the "surge" CLI
`surge` is patched using [patch-package](https://www.npmjs.com/package/patch-package) to integrate bug fixes not available in a released version:
- https://github.com/sintaxi/surge/issues/307 "Surge List not working" implementation from https://github.com/sintaxi/surge/pull/319 (opened in 2018-04-10)
The patch has been initiated and is updated by running `npx patch-package surge` to integrate local changes done in `node_modules/surge/lib`
To benefit from the patches, run the following commands from the root of this repository:
- `npm install`
- then run `npx surge ...`
## Troubleshoot domains list errors
Because of [surge#307](https://github.com/sintaxi/surge/issues/307), the [surge-teardown-old-domains](./.github/workflows/surge-teardown-old-domains.yml) workflow may fail with the following error:
```
/home/runner/.npm/_npx/23158936acd5c32d/node_modules/surge/lib/middleware/list.js:44
project.timeAgoInWords.grey,
^
TypeError: Cannot read properties of undefined (reading 'grey')
at /home/runner/.npm/_npx/23158936acd5c32d/node_modules/surge/lib/middleware/list.js:44:34
at Array.forEach ()
```
The token may also be considered invalid by the [surge-preview-tools](https://github.com/bonitasoft/actions/tree/main/packages/surge-preview-tools) action for the same reason as it performs a `surge --list` to validate the token.
In this case, the patch can help
- run the "surge list" command locally or with the [surge-list-domains](https://github.com/process-analytics/surge.sh-pa-admin/actions/workflows/surge-list-domains.yml) workflow
- detect the domain with missing information. In the following example, the first domain has issue
```
Run npx surge --token *** list
process-analytics-process-analytics-dev-site_preview-pr-1038.surge.sh N/A N/A N/A Standard
1688564549686 process-analytics-process-analytics-dev-site_preview-pr-1013.surge.sh 6 days ago surge surge.sh Standard
1688562584180 process-analytics-bpmn-visualization-js-demo_preview-pr-2748.surge.sh 6 days ago surge surge.sh Standard
```
- teardown the domains that cause issue
- relaunch the previously failing commands. They should succeed now.