generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (94 loc) · 2.94 KB
/
build-and-test.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
name: "Build and Test"
on:
workflow_dispatch:
pull_request:
branches-ignore:
- dependabot/*
push:
tags-ignore:
- "v1"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# test action works running from the graph
test:
runs-on: ubuntu-latest
steps:
- name: 👷 Checkout repo
uses: actions/checkout@v4
- name: 🏗️ Install dependencies/prepare action
run: npm install && npm run build
- name: ✔️ Test Action
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Starting Notification Tests"
color: "info"
- name: 💬 Send Test Simple Notification
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: false
title: "Notification Test"
message: "This is an example of a simple notification with a title and a body"
- name: 📤 Send Test Info Notification
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Deployment Started"
color: "info"
- name: ⚠️ Send Test Cancelled Notification
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Deployment Cancelled"
color: "warning"
- name: ⛔ Send Test Failure Notification
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Deployment Failed"
color: "failure"
- name: 🎉 Send Test Success Notification
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Deployment Successful"
color: "success"
- name: ✔️ Test Action Complete
uses: ./
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Notification Tests Complete"
color: "info"
- name: 📦 Create and upload build artifact
uses: actions/upload-artifact@v4
with:
name: typescript-docs-artifact
path: "docs/publish"
retention-days: 1
call-deploy-workflow:
needs: [test]
uses: mikesprague/reusable-workflows/.github/workflows/pages-deploy.yml@main
secrets:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN}}
with:
artifact-name: typescript-docs-artifact