-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (46 loc) · 1.48 KB
/
ci-cd.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
name: CI/CD
on:
push:
branches:
- main
jobs:
release:
name: Release & Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun_version: latest
- name: Install dependencies
run: bun i
- name: Run Semantic Release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
res=$(npx semantic-release | { tail -n 1 | grep -q "There are no relevant changes" && echo 0 || echo 1; })
echo "NEW_RELEASE=$res" >> $GITHUB_OUTPUT
# Vercel deploy is triggered manually here to:
# - ensure it only runs when app code has changed (feat, fix, perf)
# - ensure it runs after Semantic Release and so has access to latest sources
- name: Trigger Vercel update
env:
NEW_RELEASE: ${{ steps.semantic-release.outputs.NEW_RELEASE }}
run: |
if [ $NEW_RELEASE -eq 1 ]; then
# If changes are not on hardhat related stuff
#if git diff --quiet HEAD^ HEAD -- . ':!hardhat' ':!hardhat.config.ts'; then
curl --fail -X POST ${{ secrets.VERCEL_DEPLOY_HOOK }} || exit 1
#fi
else
echo "No new release, pass."
fi