-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (60 loc) · 2.26 KB
/
Copy pathci.yml
File metadata and controls
74 lines (60 loc) · 2.26 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
name: Smart Contract CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Install dependencies
run: npm ci
- name: Run tests
run: npx hardhat test
buildAndPushImage:
name: Build and Push docker image
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'publish:')
needs: test
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Set correct version
id: version
run: echo ::set-output name=version::$(node -e "console.log(require('./package.json').version);")
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
public.ecr.aws/o5j5y3t5/hardhat-thx-artifacts
tags: |
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
- name: Build
uses: docker/build-push-action@v2
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}