Skip to content

push multi arch manifest #194

push multi arch manifest

push multi arch manifest #194

Workflow file for this run

name: Pseudoniemen Service
on:
push:
branches: [ "development" ]
pull_request:
branches: [ "development" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'liberica'
cache: maven
- name: Test with Maven
run: mvn -Ppitest --batch-mode --update-snapshots verify
build:
runs-on: ${{ matrix.runner }}
if: github.event_name != 'pull_request'
strategy:
fail-fast: true
matrix:
platform: [amd64, arm64]
include:
- platform: amd64
runner: ubuntu-latest
- platform: arm64
runner: buildjet-2vcpu-ubuntu-2204
needs:
- test
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io/bhuism/pseudoniemenservice
username: bhuism
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/bhuism/pseudoniemenservice
- name: Set up Pack
uses: buildpacks/github-actions/[email protected]
with:
pack-version: 0.35.1
- name: Build and publish OCI image
run: |
pack build ghcr.io/bhuism/pseudoniemenservice:latest-${{ matrix.platform }} \
--builder docker.io/paketobuildpacks/builder-jammy-buildpackless-tiny \
--buildpack gcr.io/paketo-buildpacks/java-native-image \
--publish \
--env BP_NATIVE_IMAGE=true \
--env BP_MAVEN_ACTIVE_PROFILES=native
manifest-and-push:
runs-on: ubuntu-latest
needs: build
if: success()
steps:
- uses: actions/checkout@v3
- name: Download build' artifacts
uses: actions/download-artifact@v3
- name: merge containers and push
run: |
docker manifest create ghcr.io/bhuism/pseudoniemenservice:latest \
ghcr.io/bhuism/pseudoniemenservice:latest-amd64 ghcr.io/bhuism/pseudoniemenservice:latest-arm64 \
docker manifest push ghcr.io/bhuism/pseudoniemenservice:latest