-
Notifications
You must be signed in to change notification settings - Fork 300
108 lines (98 loc) · 3.69 KB
/
gh-pages.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
name: GitHub pages
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install deps
run: |
bun i
- name: Semantic Release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release
- name: Build demo app
env:
RELEASE_VERSION: ${{ steps.semantic-release.outputs.new-release-version }}
run: |
echo '********'
echo "RELEASE_VERSION: $RELEASE_VERSION"
echo '********'
bash .github/workflows/scripts/replace_template.sh $RELEASE_VERSION
bun run build
- name: Deploy demo
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist/ngx-mask/browser
outputs:
version: ${{ steps.semantic-release.outputs.new-release-version }}
slack_notification:
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Post to a Slack channel
id: slack
uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: 'deployments'
payload: |
{
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Project: `${{ github.event.repository.name }}`"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Website URL: ${{ secrets.WEBSITE_URL || 'TBA' }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}