Skip to content

Commit d58fba8

Browse files
Create docker-publish.yml
1 parent aa7e852 commit d58fba8

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: JIB container publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
env:
8+
# Use docker.io for Docker Hub if empty
9+
REGISTRY: ghcr.io
10+
# github.repository as <account>/<repo>
11+
IMAGE_NAME: ${{ github.repository }}
12+
# Username to login to registry
13+
USERNAME: ${{ github.actor }}
14+
# Password to login to registry
15+
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
16+
17+
jobs:
18+
publish:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
24+
- name: downcase IMAGE_NAME
25+
run: |
26+
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
27+
28+
- uses: actions/checkout@v2
29+
- name: Set up JDK 17
30+
uses: actions/setup-java@v2
31+
with:
32+
distribution: 'adopt'
33+
java-version: 17
34+
35+
- name: Buil JIB container and publish to GitHub Packages
36+
run: |
37+
mvn compile com.google.cloud.tools:jib-maven-plugin:3.1.4:build \
38+
-Djib.to.image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} \
39+
-Djib.to.auth.username=${{ env.USERNAME }} \
40+
-Djib.to.auth.password=${{ env.PASSWORD }} \
41+
-Djib.from.image=azul/zulu-openjdk:17-jre-headless

0 commit comments

Comments
 (0)