-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (84 loc) · 2.58 KB
/
deploy.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
name: 🚀 Deploy
on:
workflow_dispatch:
push:
branches:
- main
- staging
concurrency:
group: ${{ github.ref }}-deploy
env:
CI: true
permissions:
id-token: write
contents: write
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: "🔨 Install dependencies"
run: pnpm install --frozen-lockfile
- name: "👥 Configure AWS Credentials"
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::262732185023:role/github-action-deploy-role
aws-region: eu-west-1
retry-max-attempts: 5
- name: "👥 Login to Amazon ECR"
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: "🔨 Build Ponder docker dependencies"
uses: docker/build-push-action@v6
with:
context: ./packages/ponder
platforms: linux/arm64
push: true
tags: |
262732185023.dkr.ecr.eu-west-1.amazonaws.com/indexer:latest
262732185023.dkr.ecr.eu-west-1.amazonaws.com/indexer:${{ github.sha }}
# Github actions cache
cache-from: type=gha
cache-to: type=gha,mode=max
- name: "🔨 Build ERPC docker dependencies"
uses: docker/build-push-action@v6
with:
context: ./packages/erpc
platforms: linux/arm64
push: true
tags: |
262732185023.dkr.ecr.eu-west-1.amazonaws.com/erpc:latest
262732185023.dkr.ecr.eu-west-1.amazonaws.com/erpc:${{ github.sha }}
# Github actions cache
cache-from: type=gha
cache-to: type=gha,mode=max
- name: "🚀 SST Deploy"
run: |
echo "Deploying with stage: prod"
pnpm sst deploy --stage prod
env:
COMMIT_SHA: ${{ github.sha }}