-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d75022
commit dc07d6a
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: "Bento Build" | ||
description: "Composite GitHub action for building Bento images" | ||
inputs: | ||
container-name: | ||
description: "Container name" | ||
required: true | ||
development-dockerfile: | ||
description: "Development Dockerfile path" | ||
required: true | ||
default: "dev.Dockerfile" | ||
production-dockerfile: | ||
description: "Production Dockerfile path" | ||
required: true | ||
default: "Dockerfile" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into the container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up development image metadata | ||
id: meta-dev | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ inputs.container-name }} | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=raw,value=latest-dev,enable={{is_default_branch}} | ||
type=ref,event=pr | ||
type=sha,prefix=sha- | ||
- name: Build and push development image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ${{ inputs.development-dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta-dev.outputs.tags }} | ||
labels: ${{ steps.meta-dev.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Set up production image metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
if: ${{ github.event_name == 'release' }} | ||
with: | ||
images: | | ||
${{ inputs.container-name }} | ||
flavor: | | ||
latest=true | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push production image | ||
uses: docker/build-push-action@v3 | ||
if: ${{ github.event_name == 'release' }} | ||
with: | ||
context: . | ||
file: ${{ inputs.production-dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64 |