Skip to content

Commit

Permalink
action: separate deploy (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko committed Sep 3, 2021
1 parent c85ae64 commit 097fef4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 33 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Maven build
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '8']
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@v2
- name: Java ${{ matrix.Java }} (${{ matrix.os }})
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-repository
- name: Build with Maven
env:
MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
run: mvn --batch-mode --update-snapshots package --file pom.xml
44 changes: 12 additions & 32 deletions .github/workflows/maven.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
name: Build with Maven
name: Deploy Maven

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

workflow_run:
push:
branches: [ master ]
workflows: ["Build Maven"]
types: [completed]
workflow_dispatch:
jobs:
build:
name: Maven build
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '8']
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@v2
- name: Java ${{ matrix.Java }} (${{ matrix.os }})
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-repository-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-repository
- name: Build with Maven
env:
MAVEN_OPTS: -Dhttps.protocols=TLSv1.2 -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.count=10
run: mvn --batch-mode --update-snapshots package --file pom.xml
deploy:
name: Maven deploy
needs: build
if: ${{ github.event_name=='push' && github.ref=='refs/heads/master'}}
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == '' }}
runs-on: 'ubuntu-latest'
steps:
- name: Print github context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Install gpg secret key
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## <img alt="OpenAM Logo" src="https://github.com/OpenIdentityPlatform/OpenAM/raw/master/logo.png" width="300"/>
[![Latest release](https://img.shields.io/github/release/OpenIdentityPlatform/OpenAM.svg)](https://github.com/OpenIdentityPlatform/OpenAM/releases)
[![Build](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/maven.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/maven.yml)
[![Build](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/build.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/build.yml)
[![Deploy](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/deploy.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenAM/actions/workflows/deploy.yml)
[![Issues](https://img.shields.io/github/issues/OpenIdentityPlatform/OpenAM.svg)](https://github.com/OpenIdentityPlatform/OpenAM/issues)
[![Last commit](https://img.shields.io/github/last-commit/OpenIdentityPlatform/OpenAM.svg)](https://github.com/OpenIdentityPlatform/OpenAM/commits/master)
[![License](https://img.shields.io/badge/license-CDDL-blue.svg)](https://github.com/OpenIdentityPlatform/OpenAM/blob/master/LICENSE.md)
Expand Down

0 comments on commit 097fef4

Please sign in to comment.