vnobo is Build Boot Image Actions #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- 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@v3 | |
- name: Execute Gradle platform bootBuildImage | |
run: | | |
chmod +x ./gradlew | |
./gradlew bootBuildImage | |
- name: Log into registry ${{ env.GITHUB_REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.GITHUB_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.PAGK_TOKEN }} | |
- name: Log into registry ${{ env.DOCKER_REGISTRY }} | |
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.0.0 | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=ref,event=branch | |
- name: Tag platform docker image | |
run: | | |
while IFS= read -r tag; do | |
echo "Tagging image $tag" | |
docker tag plate-platform "$tag" | |
done <<< "${{ steps.meta.outputs.tags }}" | |
- name: Push docker platform image to DockerHub | |
run: | | |
docker push --all-tags ${{ env.GITHUB_REGISTRY }}/plate-platform | |
docker push --all-tags ${{ env.DOCKER_REGISTRY }}/plate-platform | |
- 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: Tag oauth2 docker image | |
run: | | |
while IFS= read -r tag; do | |
echo "Tagging image $tag" | |
docker tag plate-oauth2 $tag | |
done <<< "${{ steps.oauth2.outputs.tags }}" | |
- name: Push docker oauth2 image to DockerHub | |
run: | | |
docker push --all-tags ${{ env.GITHUB_REGISTRY }}/plate-oauth2 | |
docker push --all-tags ${{ env.DOCKER_REGISTRY }}/plate-oauth2 | |