-
Notifications
You must be signed in to change notification settings - Fork 47
60 lines (51 loc) · 1.76 KB
/
build-images.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
name: Build Images
on:
push:
branches:
- github-runner
jobs:
build-images:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
DOCKER_HUB_PARACHAIN: kiltprotocol/kilt-node
DOCKER_HUB_STANDALONE: kiltprotocol/standalone-node
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: kiltprotocol/dip-provider-node-template
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: kiltprotocol/dip-consumer-node-template
AWS_REGISTRY: ${{ secrets.ECR_REGISTRY }}
CI_COMMIT_SHORT_SHA: ${{ github.sha }}
CI_COMMIT_BRANCH: ${{ github.ref_name }}
CI_COMMIT_TAG: ${{ github.ref_name }}
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
- name: Checkout
uses: actions/checkout@v4
- name: Display AWS and Docker Versions
run: |
aws --version
docker --version
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to ECR
uses: docker/login-action@v3
with:
registry: ${{ secrets.ECR_REGISTRY }}
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Build Docker Images
run: |
./.maintain/build-image.sh build
- name: Push Image - Tag
if: startsWith(github.ref, 'refs/tags/')
run: |
./.maintain/push-image.sh build "${{ env.CI_COMMIT_TAG }}"
- name: Push Image - Latest
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-rc') && !contains(github.ref, 'dev-')
run: |
./.maintain/push-image.sh build "latest"