Skip to content

Commit

Permalink
fix #40 - Publish artifact when commit message contains "[publish]"
Browse files Browse the repository at this point in the history
- Update GitHub action
  • Loading branch information
rogelio-blanco committed Sep 9, 2022
1 parent 36fe3ec commit 8d5de7c
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,56 @@ name: Publish

on:
push:
branches:
- develop
branches: [ develop ]

permissions:
contents: read

jobs:
build:
name: Compile and Test code
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: build
env:
GITHUB_USER: ${{secrets.ARTIFACT_REPO_USER}}
GITHUB_TOKEN: ${{secrets.ARTIFACT_REPO_TOKEN}}
PRISM_NODE_HOST: ${{secrets.PRISM_NODE_HOST}}
PRISM_SDK_PASSWORD: ${{secrets.PRISM_SDK_PASSWORD}}
PRISM_SDK_USER: ${{secrets.PRISM_SDK_USER}}

publish:
name: Publish Artifacts
runs-on: ubuntu-latest

needs: [build]
if: "contains(github.event.head_commit.message, '[publish]')"
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Publish with Gradle
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
with:
arguments: publish
env:
GITHUB_USER: ${{secrets.ARTIFACT_REPO_USER}}
GITHUB_TOKEN: ${{secrets.ARTIFACT_REPO_TOKEN}}
PRISM_NODE_HOST: ${{secrets.PRISM_NODE_HOST}}
PRISM_SDK_PASSWORD: ${{secrets.PRISM_SDK_PASSWORD}}
PRISM_SDK_USER: ${{secrets.PRISM_SDK_USER}}


0 comments on commit 8d5de7c

Please sign in to comment.