Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tonit committed Sep 30, 2024
1 parent 66c8067 commit 3372421
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/actions/hello-world/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ runs:
steps:
- name: Say Hello
run: |
echo MY_BAR=42>> $GITHUB_ENV
echo MY_BAR=super.war>> $GITHUB_ENV
echo "Hello ${{ inputs.yourname }}"
shell: bash
33 changes: 33 additions & 0 deletions .github/actions/write-summary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'write-summary'
description: 'Write Step Summary of a Deployment'
inputs:
artifact-name:
description: 'Artifact Name'
required: true
artifact-version:
description: 'Artifact Version'
required: true
artifact-checksum:
description: 'SHA Sum'
required: true
successful:
description: 'Was the deployment successful?'
required: true

runs:
using: "composite"
steps:
- name: Summary Header Success
if: ${{inputs.successful}}
shell: bash
run: |
envsubst < .github/summary-header.md >> $GITHUB_STEP_SUMMARY
echo "| ${{inputs.artifact-name}} | ${{inputs.artifact-version }} | ${{inputs.artifact-checksum }} | 🟢 |" >> $GITHUB_STEP_SUMMARY
- name: Summary Header Failure
if: ${{inputs.successful}}
shell: bash
run: |
envsubst < .github/summary-header.md >> $GITHUB_STEP_SUMMARY
echo "| ${{inputs.artifact-name}} | ${{inputs.artifact-version }} | ${{inputs.artifact-checksum }} | 🔴 |" >> $GITHUB_STEP_SUMMARY
8 changes: 2 additions & 6 deletions .github/summary-header.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
## Deployment Summary

Version: ${MY_VERSION}

| Artifact | Smoke Test |
|---------------|-----------|
| Artifact | Version | Checksum | Deployment | Smoke Test |
|---------------|---------|----------|-------------|------------|
29 changes: 17 additions & 12 deletions .github/workflows/anatomy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,25 @@ jobs:
uses: './.github/actions/hello-world'
with:
yourname: 'Toni'
- name: Number 1
- name: small
shell: bash
run: |
export MY_FOO=BAR
envsubst < .github/summary-header.md >> $GITHUB_STEP_SUMMARY
echo "| $MY_FOO | 🟢 |" >> $GITHUB_STEP_SUMMARY
echo "| $MY_BAR | 🟢 |" >> $GITHUB_STEP_SUMMARY
echo "| ${{env.MY_BAR}} | 🟢 |" >> $GITHUB_STEP_SUMMARY
- name: Number 2
shell: bash
run: |
echo Other: ${MY_FOO}
echo From Action: ${MY_BAR}
echo "| $MY_BAR | 🟢 |" >> $GITHUB_STEP_SUMMARY
echo SHA1=ABC>> $GITHUB_ENV
- name: summary
uses: './.github/actions/write-summary'
with:
artifact-name: "foo"
artifact-checksum: ${{env.SHA1}}
artifact-version: "1.0.0"
successful: true
- name: summary2
uses: './.github/actions/write-summary'
with:
artifact-name: "other"
artifact-checksum: ${SHA1}
artifact-version: "1.0.0"
successful: false




0 comments on commit 3372421

Please sign in to comment.