-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (99 loc) · 3.31 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Publish
on:
# This allows us to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
version-strategy:
type: choice
description: 'Version strategy'
required: true
options:
- 'patch'
- 'minor'
- 'major'
default: patch
title:
type: string
description: 'Release title'
required: true
concurrency:
group: deploy
cancel-in-progress: true
jobs:
update_package_version:
name: Update package version
runs-on: ubuntu-latest
steps:
- name: Notify Slack about new release
uses: ravsamhq/notify-slack-action@bca2d7f5660b833a27bda4f6b8bef389ebfefd25 # v2.3.0
with:
notification_title: "⏳ Starting new constructor-ui-quizzes deployment"
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- uses: actions/checkout@v4
- uses: oleksiyrudenko/gha-git-credentials@ac5b66bcf3873df4259c681d957d8c145980171f # v2.1.1
with:
token: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/setup-node@v3
with:
node-version: '18.12.x'
- name: Install dependencies
run: npm ci
- name: Get latest release
id: last-release
uses: pozetroninc/github-action-get-latest-release@d1dafdb6e338bdab109e6afce581a01858680dfb # v0.7.0
with:
repository: ${{ github.repository }}
excludes: "prerelease, draft"
- name: Create new git tag
uses: "./.github/actions/create-version-tag"
id: tag
with:
last-version: ${{ steps.last-release.outputs.release }}
version-strategy: ${{ inputs.version-strategy }}
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
outputs:
version: ${{ steps.tag.outputs.next-version }}
create_github_release:
name: Create GitHub release
needs: update_package_version
uses: ./.github/workflows/create-github-release.yml
with:
version: ${{ needs.update_package_version.outputs.version }}
title: ${{ github.event.inputs.title }}
secrets: inherit
publish_to_npm:
name: Publish to NPM
needs: [create_github_release, update_package_version]
uses: ./.github/workflows/publish-npm.yml
with:
version: ${{ needs.update_package_version.outputs.version }}
secrets: inherit
deploy_storybook:
needs: publish_to_npm
name: Deploy Storybook
uses: ./.github/workflows/deploy-storybook.yml
final_deployment_notification:
name: Final deployment notification
runs-on: ubuntu-latest
if: always()
needs: [
create_github_release,
publish_to_npm,
update_package_version,
deploy_storybook
]
steps:
- name: Get workflow conclusion
id: workflow-conclusion
uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3
with:
STRICT_SUCCESS: true
- name: Report deployment status to Slack
uses: ravsamhq/notify-slack-action@v2
with:
notification_title: "🏁 Constructor-ui-quizzes deployment completed"
status: ${{ steps.workflow-conclusion.outputs.conclusion }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}