-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker build action * publish on release * add arm64 image * remove arm64 build
- Loading branch information
1 parent
f792c1e
commit 631c30b
Showing
1 changed file
with
75 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,75 @@ | ||
name: Build and Publish Docker images | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
SINK_IMAGE_NAME: ${{ github.repository }}-sink | ||
API_IMAGE_NAME: ${{ github.repository }}-api | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Needed for git describe | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Sink | ||
id: meta-sink | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.SINK_IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=raw,value=latest | ||
- name: Extract metadata (tags, labels) for API | ||
id: meta-api | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=raw,value=latest | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push Sink image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/Dockerfile | ||
target: sink | ||
push: true | ||
tags: ${{ steps.meta-sink.outputs.tags }} | ||
labels: ${{ steps.meta-sink.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and push API image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/Dockerfile | ||
target: api | ||
push: true | ||
tags: ${{ steps.meta-api.outputs.tags }} | ||
labels: ${{ steps.meta-api.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |