ENG-5519 Updating references #275
Workflow file for this run
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
name: PUB | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
PPL_TEMPLATE_VERSION: "v2.0.4" | |
ENTANDO_BOT_TOKEN: ${{ secrets.ENTANDO_BOT_TOKEN }} | |
PR_CHECKER_PATH: ".github/pr-title-checker-config.json" | |
JDK_VERSION: 17 | |
BUILD_COMMANDS: mvn package -Pjvm; | |
DEPLOY_COMMANDS: -B javadoc:jar source:jar source:test-jar -DskipTests=true -DaltDeploymentRepository=${{ vars.NEXUS_SERVER_ID }}::default::${{ vars.NEXUS_INSTANCE_URI }} -Pprepare-for-nexus -DskipPreDeploymentTests=true -DskipPostDeploymentTests=true -Ddependency-check.skip=true | |
DOCKER_IMAGE_BASE_NAME: entando/entando-k8s-app-controller | |
DOCKER_IMAGE_ARCHITECTURE: linux/amd64,linux/arm64 | |
DOCKER_IMAGE_CONTEXT: . | |
DOCKER_IMAGE_FILE: Dockerfile.jvm | |
DOCKER_IMAGE_PUSH: true | |
jobs: | |
check-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: thehanimo/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pass_on_octokit_error: false | |
configuration_path: ${{ env.PR_CHECKER_PATH }} | |
publication: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: "Set up JDK ${{ env.JDK_VERSION }}" | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ env.JDK_VERSION }} | |
- name: "Cache Maven packages" | |
id: cache-maven | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2 | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Setting up variables | |
run: | | |
REF_VERSION=${GITHUB_REF_NAME:1} | |
REF_VERSION=${REF_VERSION/+*} | |
echo "REF_VERSION=$REF_VERSION" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: ${{ env.BUILD_COMMANDS }} | |
- name: Updating pom.xml version | |
run: mvn versions:set -DnewVersion=${{ env.REF_VERSION }} | |
- name: Release Maven package | |
uses: samuelmeuli/action-maven-publish@v1 | |
with: | |
server_id: ${{ vars.NEXUS_SERVER_ID }} | |
nexus_username: ${{ secrets.NEXUS_USERNAME }} | |
nexus_password: ${{ secrets.NEXUS_PASSWORD }} | |
maven_args: ${{ env.DEPLOY_COMMANDS }} | |
maven_goals_phases: deploy | |
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg_passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Check for Dockerfile | |
id: dockerfile | |
uses: andstor/file-existence-action@v2 | |
with: | |
files: Dockerfile* | |
- name: Docker meta | |
if: steps.dockerfile.outputs.files_exists == 'true' | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.DOCKER_IMAGE_BASE_NAME }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr,value={{base_ref}} | |
type=ref,event=tag | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
type=raw,event=pr,value={{base_ref}} | |
- name: Set up QEMU | |
if: steps.dockerfile.outputs.files_exists == 'true' | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
if: steps.dockerfile.outputs.files_exists == 'true' | |
uses: docker/setup-buildx-action@v2 | |
with: | |
platforms: ${{ env.DOCKER_IMAGE_ARCHITECTURE }} | |
- name: Login to Docker Hub | |
if: steps.dockerfile.outputs.files_exists == 'true' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.ENTANDO_OPT_DOCKER_USERNAME }} | |
password: ${{ secrets.ENTANDO_OPT_DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
if: steps.dockerfile.outputs.files_exists == 'true' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ env.DOCKER_IMAGE_CONTEXT }} | |
file: ${{ env.DOCKER_IMAGE_FILE }} | |
push: ${{ env.DOCKER_IMAGE_PUSH }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: ${{ env.DOCKER_IMAGE_ARCHITECTURE }} |