-
Notifications
You must be signed in to change notification settings - Fork 71
65 lines (62 loc) · 1.86 KB
/
periodic-build.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
name: Periodic build
on:
schedule:
- cron: 0 0 * * *
push:
branches:
- 'feature/periodic-build-canary'
concurrency:
group: release-canary
jobs:
notify-start:
name: Notify release start
uses: ho-nl/release-slack-action/.github/workflows/notify-slack-start.yml@main
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN }}
with:
channel: slack-test-messages
message: Graphcommerce start building
notifyOnlyOnFailure: true
publish:
strategy:
matrix:
version: [18, 20, 22]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: graphcommerce
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
registry-url: 'https://registry.npmjs.org'
scope: 'graphcommerce'
- name: Prepare and build graphcommerce
run: |
cp -R graphcommerce/examples/magento-graphcms/. graphcommerce-build
cd graphcommerce-build
corepack enable
yarn
yarn codegen
yarn build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# notify-end will run only if any publish job failed
notify-end:
if: always()
needs: [notify-start, publish]
name: Notify release end
uses: ho-nl/release-slack-action/.github/workflows/notify-slack-end.yml@main
secrets:
slackToken: ${{ secrets.SLACK_BOT_RELEASE_TOKEN }}
with:
time: ${{ needs.notify-start.outputs.time }}
result: ${{ needs.publish.result }}
channel: slack-test-messages
message: "One or more Node.js versions failed in the periodic canary build"
notifyOnlyOnFailure: true