Skip to content

Commit a955ea7

Browse files
authored
Merge pull request #4 from culiops/features/add_release_ci
add docker build ci
2 parents bea0c8e + 274635b commit a955ea7

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
release:
55
types: [created]
66

7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
711
jobs:
812
releases-matrix:
913
name: Release Go Binary
@@ -28,4 +32,35 @@ jobs:
2832
goversion: "1.19"
2933
project_path: "./extensions"
3034
binary_name: "fluentd-lambda-extension"
31-
extra_files: LICENSE README.md
35+
extra_files: LICENSE README.md
36+
37+
build-and-push-image:
38+
runs-on: ubuntu-latest
39+
permissions:
40+
contents: read
41+
packages: write
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v3
46+
47+
- name: Log in to the Container registry
48+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
49+
with:
50+
registry: ${{ env.REGISTRY }}
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Extract metadata (tags, labels) for Docker
55+
id: meta
56+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
57+
with:
58+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
59+
60+
- name: Build and push Docker image
61+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
62+
with:
63+
context: ./extensions
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)