-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.2 KB
/
build.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
name: Build 👷
on:
push:
branches-ignore: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
deployment:
strategy:
matrix:
arch: [amd64, arm64]
name: Build the image
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository }}:${{ github.sha }}
AWS_CLI_VERSION: "2.16.11"
ALPINE_VERSION: "3.20"
steps:
- name: Check out repository code
uses: actions/checkout@main
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.arch == 'arm64'
with:
platforms: linux/arm64
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Build the image
uses: docker/build-push-action@v6
with:
platforms: linux/${{ matrix.arch }}
load: true
push: false
build-args: |
AWS_CLI_VERSION=${{ env.AWS_CLI_VERSION }}
ALPINE_VERSION=${{ env.ALPINE_VERSION }}
tags: ${{ env.IMAGE_NAME }}
- name: Test if AWS CLI works
run: |
docker run --rm ${{ env.IMAGE_NAME }} sh -c "/aws-cli-bin/aws --version"