Skip to content

vnobo is Build Boot Image Actions #70

vnobo is Build Boot Image Actions

vnobo is Build Boot Image Actions #70

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Gradle Build Image
run-name: ${{ github.actor }} is Build Boot Image Actions
on:
push:
branches: [ "main","dev" ]
release:
types: [ created ]
env:
GITHUB_REGISTRY: ghcr.io/${{ github.actor }}
DOCKER_REGISTRY: alexbob
jobs:
boot-build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
version: 'latest'
java-version: '21'
distribution: 'liberica'
architecture: x64
settings-path: ${{ github.workspace }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Execute Gradle platform bootBuildImage
run: |
chmod +x ./gradlew
./gradlew bootBuildImage
- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PAGK_TOKEN }}
- name: Log into registry ${{ env.DOCKER_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract platform metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
flavor: |
latest=true
images: |
${{ env.GITHUB_REGISTRY }}/plate-platform
${{ env.DOCKER_REGISTRY }}/plate-platform
tags: |
type=semver,pattern={{version}},value=v3.4.0
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Build and Push Platform
uses: docker/build-push-action@v6
with:
context: ./boot/platform
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Extract oauth2 metadata (tags, labels) for Docker
id: oauth2
uses: docker/metadata-action@v5
with:
flavor: |
latest=true
images: |
${{ env.GITHUB_REGISTRY }}/plate-oauth2
${{ env.DOCKER_REGISTRY }}/plate-oauth2
tags: |
type=semver,pattern={{version}},value=v3.4.0
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Build and Push Oauth2
uses: docker/build-push-action@v6
with:
context: ./boot/oauth2
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.oauth2.outputs.tags }}
labels: ${{ steps.oauth2.outputs.labels }}