Skip to content

Commit

Permalink
Merge pull request #10 from eclipse-ee4j/docker-deploy-github-action
Browse files Browse the repository at this point in the history
Create docker-publish.yml
  • Loading branch information
dmatej authored Aug 6, 2024
2 parents 36c87fc + dad5395 commit c41e2a5
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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: Maven Build
run: set -x && mvn -v && mvn clean package -Dglassfish.version=$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:$IMAGE_VERSION && docker image tag glassfish:$IMAGE_VERSION $IMAGE_ID:latest && docker images | sort

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Docker Push
run: |
docker push $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:latest

0 comments on commit c41e2a5

Please sign in to comment.