-
Notifications
You must be signed in to change notification settings - Fork 20
53 lines (46 loc) · 1.72 KB
/
monitoring-build-push-ecr.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
name: "Build and push on-chain monitor image to ECR"
on:
push:
branches:
- develop
paths:
- monitoring/**
- relayer/**
jobs:
build-and-publish-monitoring:
runs-on: ubuntu-latest
environment: publish
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_ARN }}
role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to ECR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ secrets.MONITORING_ECR_HOSTNAME }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # v2.2.1
- name: Generate docker metadata
id: docker_meta
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # v4.1.1
with:
flavor: | # prevent auto tagging with latest
latest=false
images: ${{ secrets.MONITORING_ECR_HOSTNAME }}
tags: type=sha,format=long
- name: Build and push docker image
uses: docker/build-push-action@c56af957549030174b10d6867f20e78cfd7debc5 # v3.2.0
with:
push: true
context: ./
file: monitoring/ops/Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}