1
+ name : Build
2
+ on : [push]
3
+
4
+ env :
5
+ CI_BUILD_NUM : ${{ github.run_id }}
6
+ CI_BRANCH : ${{ github.ref_name }}
7
+ CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
8
+
9
+ permissions :
10
+ id-token : write
11
+ contents : write # semantic-release-dry verifies the write permissions
12
+ issues : read # needed by semantic-release
13
+ pull-requests : write # needed by semantic-release
14
+
15
+ jobs :
16
+ test :
17
+ name : Test
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - uses : actions/checkout@v4
21
+ - name : Use Node.js 20.x
22
+ uses : actions/setup-node@v4
23
+ with :
24
+ node-version : ' 20.x'
25
+ - run : npm install
26
+ - run : npm test
27
+ # - uses: codecov/codecov-action@v4
28
+ # with:
29
+ # token: ${{ secrets.CODECOV_TOKEN }}
30
+
31
+ test-deploy :
32
+ name : Test Deploy
33
+ runs-on : ubuntu-latest
34
+ if : github.ref != 'refs/heads/main'
35
+ needs : test
36
+ steps :
37
+ - uses : actions/checkout@v4
38
+ - name : Use Node.js 20.x
39
+ uses : actions/setup-node@v4
40
+ with :
41
+ node-version : ' 20.x'
42
+ - run : npm install
43
+ - name : extracting last commit message
44
+ run : |
45
+ echo "CI_LAST_COMMIT_MSG=$(git show -s --format="%s")" >> $GITHUB_ENV
46
+ echo CI_LAST_COMMIT_MSG
47
+ - name : Branch Deployment
48
+ run : npm run deploy:ci
49
+ - name : Post-Deployment Integration Test
50
+ run : npm run test-postdeploy
51
+ - name : Semantic Release (Dry Run)
52
+ run : npm run semantic-release-dry
53
+ env :
54
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
+
56
+ release :
57
+ name : Release
58
+ runs-on : ubuntu-latest
59
+ if : github.ref == 'refs/heads/main'
60
+ needs : test
61
+ steps :
62
+ - uses : actions/checkout@v4
63
+ - name : Use Node.js 20.x
64
+ uses : actions/setup-node@v4
65
+ with :
66
+ node-version : ' 20.x'
67
+ - run : npm install
68
+ - name : extracting last commit message
69
+ run : |
70
+ echo "CI_LAST_COMMIT_MSG=$(git show -s --format="%s")" >> $GITHUB_ENV
71
+ echo CI_LAST_COMMIT_MSG
72
+ - name : Semantic Release
73
+ run : npm run semantic-release
74
+ env :
75
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments