-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (57 loc) · 1.43 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and Push Docker Images
on:
push:
workflow_dispatch:
# schedule:
# - cron: '0 0 * * *' # runs every day at midnight
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
alpine_version:
- 2.7
- 3.1
- 3.2
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- 3.13
- 3.14
- 3.15
- 3.16
- 3.17
- 3.18
- 3.19
- latest
- edge
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Image
run: |
if [ -f "Dockerfile-${{ matrix.alpine_version }}" ]; then
DOCKERFILE=Dockerfile-${{ matrix.alpine_version }}
else
DOCKERFILE=Dockerfile
fi
docker buildx build \
--push \
--pull \
--quiet \
--platform linux/amd64,linux/arm64 \
--tag andrius/alpine-ruby:${{ matrix.alpine_version }} \
--build-arg ALPINE_VERSION=${{ matrix.alpine_version }} \
--file $DOCKERFILE
.