Skip to content

Commit a08d886

Browse files
Inline CD pipeline for debugging (#168)
* Inline CD pipeline for debugging * add git diff --------- Co-authored-by: Teal Stannard <[email protected]>
1 parent 7f8a9a3 commit a08d886

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

.github/workflows/cd.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ on:
77
branches: [main]
88

99
jobs:
10-
call-workflow-from-shared-config:
11-
uses: rubyatscale/shared-config/.github/workflows/cd.yml@main
12-
secrets: inherit
10+
deploy:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Check Git Status
16+
run: git status
17+
- name: Tag and Push Gem
18+
id: tag-and-push-gem
19+
uses: discourse/publish-rubygems-action@v3
20+
env:
21+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
22+
GIT_EMAIL: ${{secrets.GUSTO_GIT_EMAIL}}
23+
GIT_NAME: ${{secrets.GUSTO_GIT_NAME}}
24+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
25+
RELEASE_COMMAND: git diff && rake release --backtrace
26+
- name: Create GitHub Release
27+
run: gh release create v${{steps.tag-and-push-gem.outputs.gem_version}} --generate-notes
28+
if: ${{ steps.tag-and-push-gem.outputs.new_version == 'true' }}
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
notify_on_failure:
32+
runs-on: ubuntu-latest
33+
needs: [deploy]
34+
if: ${{ failure() && github.ref == 'refs/heads/main' }}
35+
env:
36+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
37+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
38+
steps:
39+
- uses: slackapi/[email protected]
40+
with:
41+
payload: |
42+
{
43+
"text": "${{ github.repository }}/${{ github.ref }}: FAILED\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
44+
}

0 commit comments

Comments
 (0)