-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (68 loc) · 2.37 KB
/
deploy.yml
File metadata and controls
83 lines (68 loc) · 2.37 KB
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
name: Build, Deploy Contracts & Publish to Vercel
on:
push:
branches:
- main
pull_request:
branches:
- main
- next
workflow_dispatch:
env:
PASSWORD: ${{ secrets.PASSWORD }}
permissions:
contents: read
pull-requests: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Enable Corepack
run: corepack enable
- name: Install dependencies
run: yarn install --immutable
- name: Install Aztec CLI
run: |
VERSION=$(jq -r '.dependencies["@aztec/aztec.js"]' package.json)
VERSION_NO_V=${VERSION#v}
echo "Installing Aztec version: $VERSION_NO_V"
curl -s https://install.aztec.network/$VERSION_NO_V/ -o tmp.sh
echo "Downloaded script, first 5 lines:"
head -5 tmp.sh
bash tmp.sh
echo "Install script completed"
ls -la ~/.aztec/bin/ || echo "~/.aztec/bin does not exist"
- name: Update path
run: echo "/home/runner/.aztec/bin" >> $GITHUB_PATH
- name: Compile contracts
run: yarn compile:contracts
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
id: deploy
run: |
if [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then
DEPLOY_URL=$(vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz --yes)
else
DEPLOY_URL=$(vercel deploy --token=${{ secrets.VERCEL_TOKEN }} --archive=tgz --yes)
fi
echo "url=$DEPLOY_URL" >> $GITHUB_OUTPUT
- name: Comment deployment URL on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🚀 Deployed to Vercel!\n\n**Preview URL:** ${{ steps.deploy.outputs.url }}'
})