* Start parallel Docker image deploy workflows Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: James M. Greene <JamesMGreene@users.noreply.github.com> * Add early access content build stage Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> * Create Heroku App script and workflow steps * Tag the image for Heroku * Push the image and grab the image ID * Set app name and image id outputs * Add parallel deploy script for Docker * Scope workflow run to 'docker-' and release image to Heroku * Update .github/workflows/staging-build-pr-docker.yml Co-authored-by: James M. Greene <JamesMGreene@github.com> * Exclude Docker workflow * Cleanup Docker deploys * Use action sha Co-authored-by: Mike Surowiec <mikesurowiec@users.noreply.github.com> Co-authored-by: James M. Greene <JamesMGreene@users.noreply.github.com> Co-authored-by: James M. Greene <JamesMGreene@github.com>
20 lines
545 B
JavaScript
20 lines
545 B
JavaScript
#!/usr/bin/env node
|
|
import GithubSlugger from 'github-slugger'
|
|
const slugify = GithubSlugger.slug
|
|
|
|
const APP_NAME_MAX_LENGTH = 30
|
|
|
|
export default function ({ prefix = 'gha', repo, pullNumber, branch }) {
|
|
return (
|
|
`${prefix}-${repo}-${pullNumber}--${slugify(branch)}`
|
|
// Shorten the string to the max allowed length
|
|
.slice(0, APP_NAME_MAX_LENGTH)
|
|
// Convert underscores to dashes
|
|
.replace(/_/g, '-')
|
|
// Remove trailing dashes
|
|
.replace(/-+$/, '')
|
|
// Make it all lowercase
|
|
.toLowerCase()
|
|
)
|
|
}
|