-
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.
[dev] gh: build and push container image
- Loading branch information
Showing
4 changed files
with
73 additions
and
5 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,58 @@ | ||
name: build and push container image | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
filter: tree:0 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install packages | ||
run: sudo apt-get install -y make libarchive-tools unzip wget | ||
|
||
- name: build | ||
run: make | ||
|
||
- name: set version | ||
run: echo "VERSION=$(lein pprint --no-pretty -- :version)" >> $GITHUB_ENV | ||
|
||
- name: docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.IMAGE_NAME }} | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}},value=${{ env.VERSION }} | ||
type=sha | ||
- name: build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: docker/Dockerfile | ||
build-args: | | ||
VERSION=${{ env.VERSION }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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
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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
FROM ubuntu:jammy | ||
|
||
ARG VERSION | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/irq0/llar | ||
LABEL org.opencontainers.image.description="LLAR - Live Long and Read: Container Image" | ||
LABEL org.opencontainers.image.licenses=GPL | ||
LABEL org.opencontainers.image.url=https://llar.dev | ||
LABEL org.opencontainers.image.title="llar" | ||
LABEL org.opencontainers.image.description="Live Long and Read: Container Image" | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL org.opencontainers.image.licenses=AGPLv3 | ||
LABEL org.opencontainers.image.version=$VERSION | ||
|
||
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime | ||
|
||
|
@@ -36,7 +42,7 @@ ENV LANG en_US.UTF-8 | |
ENV LANGUAGE en_US.UTF-8 | ||
|
||
RUN mkdir -p /opt/llar | ||
COPY target/llar-0.1.0-SNAPSHOT-standalone.jar /opt/llar/standalone.jar | ||
COPY target/llar-$VERSION-standalone.jar /opt/llar/standalone.jar | ||
|
||
ENV LLAR_CONFIG /var/lib/llar/config.edn | ||
ENV JDK_JAVA_OPTIONS "-XshowSettings:system -XX:+UseContainerSupport -XX:MaxRAMPercentage=60 -Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory -Dtika.config=tika-config.xml" | ||
|