-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (49 loc) · 1.54 KB
/
docker-image-berlin.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
name: Berlin docker image build and push
on:
push:
branches:
- berlin-hackaton
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: [self-hosted, cere-network-large]
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Process version
id: version
run: |
echo "image_tag=berlin-${{ github.run_attempt}}-$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
- name: Build and push docker image to ECR Docker
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.tests
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.image_tag }}