Skip to content

Commit

Permalink
Setup arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk committed Aug 17, 2023
1 parent 7da8c85 commit 4102bc0
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,65 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ${{ matrix.local_path }}
package-arm:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ${{ matrix.OS }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKER_TARGET_PLATFORM: linux/arm/v7
strategy:
matrix:
OS: ["ubuntu-latest"]
include:
- os: ubuntu-latest
uploaded_filename: tgtg.jar
local_path: artifacts/tgtg.jar
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,value=${{ needs.release-please.outputs.tag_name }}
type=raw,value=latest
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@v1
with:
power: true
jvm: "temurin:17"
- name: Package app
run: scala-cli package . -o "${{ matrix.local_path }}" --assembly
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
file: ./arm.Dockerfile
build-args: "LOCAL_PATH=${{ matrix.local_path }}"
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.DOCKER_TARGET_PLATFORM }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.uploaded_filename }}
path: ${{ matrix.local_path }}
if-no-files-found: error
retention-days: 2
10 changes: 10 additions & 0 deletions arm.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ARG ARCH=
FROM ${ARCH}eclipse-temurin:17

WORKDIR /usr/src/app

ARG LOCAL_PATH

COPY ${LOCAL_PATH} tgtg.jar

ENTRYPOINT ["java", "-jar", "tgtg.jar"]

0 comments on commit 4102bc0

Please sign in to comment.