Skip to content

Docker Publish to GitHub #29

Docker Publish to GitHub

Docker Publish to GitHub #29

Workflow file for this run

name: Docker Publish to GitHub
on:
workflow_dispatch:
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_ID: "ghcr.io/${{ github.repository_owner }}/glassfish"
IMAGE_VERSION: 7.0.16
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Maven Configure
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
platforms: linux/amd64,linux/arm64
- name: Build AMD64
run: mvn clean package -Dglassfish.version=$IMAGE_VERSION -Ddocker.platforms=linux/amd64 -Ddocker.glassfish.tag=${IMAGE_VERSION}-amd64
- name: Build ARM64
run: mvn clean package -Dglassfish.version=$IMAGE_VERSION -Ddocker.platforms=linux/arm64 -Ddocker.glassfish.tag=${IMAGE_VERSION}-arm64
- name: Filter Dockerfile
run: export $(grep -v '^#' target/sha.properties | xargs) && sed 's/@glassfish.zip.sha512@/${glassfish.zip.sha512}/g' ${IMAGE_VERSION}/Dockerfile > target/Dockerfile
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Multirelease
uses: docker/build-push-action@v6
with:
file: target/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: $IMAGE_ID:$IMAGE_VERSION,$IMAGE_ID:latest
- name: Additional Info
run: |
mvn -v
uname -a
docker buildx ls
docker images | sort
docker inspect $IMAGE_ID:latest | grep Architecture