Skip to content

Commit

Permalink
actions: separate deploy (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
vharseko authored Sep 3, 2021
1 parent 503485f commit 0cc0f9a
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="OpenIG Logo" src="https://github.com/OpenIdentityPlatform/OpenIG/raw/master/logo.png" width="300"/>
[![Latest release](https://img.shields.io/github/release/OpenIdentityPlatform/OpenIG.svg)](https://github.com/OpenIdentityPlatform/OpenIG/releases)
[![Build](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/maven.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/maven.yml)
[![Build](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/build.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/build.yml)
[![Deploy](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/deploy.yml/badge.svg)](https://github.com/OpenIdentityPlatform/OpenIG/actions/workflows/deploy.yml)
[![Issues](https://img.shields.io/github/issues/OpenIdentityPlatform/OpenIG.svg)](https://github.com/OpenIdentityPlatform/OpenIG/issues)
[![Last commit](https://img.shields.io/github/last-commit/OpenIdentityPlatform/OpenIG.svg)](https://github.com/OpenIdentityPlatform/OpenIG/commits/master)
[![License](https://img.shields.io/badge/license-CDDL-blue.svg)](https://github.com/OpenIdentityPlatform/OpenIG/blob/master/LICENSE.md)
Expand Down

0 comments on commit 0cc0f9a

Please sign in to comment.