-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathaction.yml
More file actions
28 lines (28 loc) · 986 Bytes
/
action.yml
File metadata and controls
28 lines (28 loc) · 986 Bytes
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
name: Container Build
description: コンテナイメージをビルドし、ECRへプッシュします。
inputs:
ecr-repository-uri:
required: true
description: ECRリポジトリのURI
dockerfile-path:
required: true
description: Dockerfileのパス
outputs:
container-image:
value: ${{ steps.meta.outputs.tags }}
description: ビルドしたコンテナイメージ
runs:
using: composite
steps:
- uses: aws-actions/amazon-ecr-login@v2 # Amazon ECRへのログイン
- uses: docker/metadata-action@v5 # コンテナイメージのメタデータ生成
id: meta
with:
images: ${{ inputs.ecr-repository-uri }}
tags: type=sha,format=long
- uses: docker/build-push-action@v5 # コンテナイメージのビルドとプッシュ
with:
push: true
context: ${{ inputs.dockerfile-path }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}