-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (81 loc) · 2.71 KB
/
build.yml
File metadata and controls
84 lines (81 loc) · 2.71 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build
on:
push:
branches:
- '*'
schedule:
- cron: '0 0 * * Sun'
jobs:
build-image:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
debian_version:
- bullseye
ruby_version:
- '3.1'
- '3.0'
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v1
- if: github.ref == 'refs/heads/master'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: us-east-1
- if: github.ref == 'refs/heads/master'
uses: docker/login-action@v1
with:
registry: public.ecr.aws
- name: Meta data
id: meta
run: |
(
echo "timestamp=$(date --utc +%FT%TZ)"
echo "source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
echo "revision=$GITHUB_SHA"
) >> $GITHUB_OUTPUT
- name: Build runtime image
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
target: runtime
build-args: |
DEBIAN_VERSION=${{matrix.debian_version}}
RUBY_VERSION=${{matrix.ruby_version}}
tags: |
public.ecr.aws/exapico/lambda-ruby:${{matrix.debian_version}}-${{matrix.ruby_version}}
labels: |
org.opencontainers.image.created=${{steps.meta.outputs.timestamp}}
org.opencontainers.image.source=${{steps.meta.outputs.source}}
org.opencontainers.image.revision=${{steps.meta.outputs.revision}}
- name: Build builder image
uses: docker/build-push-action@v2
with:
context: .
push: false
load: true
target: builder
build-args: |
DEBIAN_VERSION=${{matrix.debian_version}}
RUBY_VERSION=${{matrix.ruby_version}}
tags: |
public.ecr.aws/exapico/lambda-ruby-builder:${{matrix.debian_version}}-${{matrix.ruby_version}}
labels: |
org.opencontainers.image.created=${{steps.meta.outputs.timestamp}}
org.opencontainers.image.source=${{steps.meta.outputs.source}}
org.opencontainers.image.revision=${{steps.meta.outputs.revision}}
- name: Test
run: run-parts --exit-on-error test
env:
DEBIAN_VERSION: ${{matrix.debian_version}}
RUBY_VERSION: ${{matrix.ruby_version}}
- if: github.ref == 'refs/heads/master'
name: Push images
run: |
docker push public.ecr.aws/exapico/lambda-ruby:${{matrix.debian_version}}-${{matrix.ruby_version}}
docker push public.ecr.aws/exapico/lambda-ruby-builder:${{matrix.debian_version}}-${{matrix.ruby_version}}