-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create-github-deployment #246
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c27ed48
Replaced update-deployment-board with create-github-deployment
hpractv a973164
Merge branch 'main' into github-deployments
danielle-casella-adams 2b44341
Apply suggestions from code review
hpractv cae5072
- Changed the update deployment board task to update github deployments
hpractv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,10 +28,9 @@ | |
# { "name": "Version", "value": "${{ inputs.tag }}" } | ||
# ] | ||
# secrets: | ||
# MS_TEAMS_URI: ${{ vars.MS_TEAMS_URI }} | ||
# MS_TEAMS_URI: ${{ vars.MS_TEAMS_URI }} | ||
# DEPLOY_NOTIFICATIONS_CHANNEL: ${{ vars.DEPLOY_NOTIFICATIONS_CHANNEL}} | ||
|
||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
|
@@ -68,11 +67,6 @@ on: | |
required: false | ||
type: string | ||
default: 'america/denver' | ||
deployment-board-number: | ||
description: 'The number of the deployment board that should be updated. Defaults to 1.' | ||
required: false | ||
type: number | ||
default: 1 | ||
deployable-type: | ||
description: 'Identifier if there are multiple deployables in the repo, like MFE, DB, API. Defaults to an empty string for single deployables.' | ||
required: false | ||
|
@@ -83,6 +77,11 @@ on: | |
required: false | ||
type: string | ||
default: null | ||
entity: | ||
description: 'The catalog-info.yml metadata.name value for mapping in Tech Hub.' | ||
required: false | ||
type: string | ||
default: null | ||
enable-deployment-slot-tracking: | ||
description: 'Enable App Service deployment slot tracking on deployment board? [true|false]' | ||
required: false | ||
|
@@ -103,6 +102,11 @@ on: | |
type: string | ||
required: false | ||
default: 'production' | ||
instance: | ||
description: 'The instance of the deployment. This is used to create a deployment instance name in the GitHub deployment API.' | ||
required: false | ||
type: string | ||
default: null | ||
custom-facts-for-team-channel: | ||
description: The custom facts that will be included in the post in the team's channel. By default Workflow, Run, Actor and Version are included. | ||
required: false | ||
|
@@ -129,23 +133,18 @@ jobs: | |
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update deployment board | ||
if: always() | ||
uses: im-open/[email protected] | ||
# Only run this step if Tech Hub metadata.name value is passed in | ||
- name: Create GitHub Deployment | ||
if: ${{ inputs.entity != null }} | ||
uses: im-open/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
workflow-actor: ${{ github.actor }} # This will add the user who kicked off the workflow to the deployment payload | ||
token: ${{ secrets.GITHUB_TOKEN }} # Special per-job token generated by GH for interacting with the repo | ||
environment: ${{ inputs.deployment-environment }} | ||
board-number: ${{ inputs.deployment-board-number }} | ||
ref: ${{ inputs.release-tag }} | ||
ref-type: 'tag' | ||
deployable-type: ${{ inputs.deployable-type }} | ||
deploy-label: ${{ inputs.deployable-label }} | ||
deploy-status: ${{ steps.conclusion.outputs.workflow_conclusion }} | ||
enable-deployment-slot-tracking: ${{ inputs.enable-deployment-slot-tracking }} | ||
slot-swapped-with-production-slot: ${{ inputs.slot-swapped-with-production-slot }} | ||
target-slot: ${{ inputs.target-slot }} | ||
source-slot: ${{ inputs.source-slot }} | ||
timezone: ${{ inputs.timezone }} | ||
release-ref: ${{ inputs.release-tag }} | ||
deployment-status: ${{ steps.conclusion.outputs.workflow_conclusion }} | ||
entity: ${{ inputs.entity }} | ||
instance: ${{ inputs.instance || inputs.target-slot }} | ||
|
||
- name: Configure facts for team's notification channel | ||
if: always() | ||
|
@@ -156,7 +155,7 @@ jobs: | |
const rawFacts = process.env.FACTS; | ||
console.log(`"${rawFacts}"`); | ||
let facts = rawFacts && rawFacts.trim().length > 0 ? JSON.parse(rawFacts) : null; | ||
|
||
if (!facts || facts.length === 0){ | ||
console.log(`Custom facts were not provided for the Team's Notification channel, use the default facts:`); | ||
facts = [ | ||
|
@@ -174,7 +173,7 @@ jobs: | |
core.setOutput('facts', facts); | ||
env: | ||
FACTS: ${{ inputs.custom-facts-for-team-channel }} | ||
|
||
- name: Send status to team's notification channel | ||
if: always() | ||
uses: im-open/[email protected] | ||
|
@@ -195,9 +194,9 @@ jobs: | |
const postInProd = ${{ inputs.post-status-in-deployment-notifications-channel }}; | ||
const deployEnv = '${{ inputs.deployment-environment }}'; | ||
const workflowConclusion = '${{ steps.conclusion.outputs.workflow_conclusion }}'; | ||
|
||
const isProdEnv = deployEnv === 'prod' || deployEnv === 'prod-secondary'; | ||
|
||
const post = postInProd && isProdEnv && workflowConclusion === 'success'; | ||
core.setOutput('post', post); | ||
|
||
|
@@ -221,7 +220,7 @@ jobs: | |
script: | | ||
const rawFacts = process.env.FACTS; | ||
let facts = rawFacts && rawFacts.trim().length > 0 ? JSON.parse(rawFacts) : null; | ||
|
||
if (!facts || facts.length === 0){ | ||
console.log('Custom facts were not provided for the Deployment Notifications channel, use the default facts:'); | ||
facts = [ | ||
|
@@ -237,7 +236,7 @@ jobs: | |
core.setOutput('facts', facts); | ||
env: | ||
FACTS: ${{ inputs.custom-facts-for-deployment-notifications-channel }} | ||
|
||
- name: Send Status to Deployment Notifications Channel for Prod Deploys | ||
if: always() && steps.post-to-deployment-channel.outputs.post == 'true' | ||
uses: im-open/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
workflow-templates/im-deploy-cleanup-automated-board.properties.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is entity too ambiguous? Would backstage-entity clarify? I kind of have the same feelings about instance because it seems like a nebulous word and doesn't convey enough meaning. I think target is the terminology used in some of the other workflows. A change like that would probably require an update to your action.