Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gradle templates #35

Merged
merged 6 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Gradle Compile & UT

on: [push, pull_request, workflow_dispatch]

jobs:
run-build-and-deploy:
uses: octopusden/octopus-base/.github/workflows/[email protected]
with:
flow-type: hybrid
java-version: '11'
docker-image: employee-service
56 changes: 10 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,16 @@
name: Release
name: Gradle Release

on:
repository_dispatch:
types: [ release ]
types: release

jobs:
build:
runs-on: ubuntu-latest
environment: Prod
steps:
- uses: actions/checkout@v3
name: Checkout(switching to commit)
with:
ref: ${{ github.event.client_payload.commit }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: GitHub Tag Name
run: |
echo "Current version: ${{ github.event.client_payload.project_version }}"
- name: Build with Gradle
run: ./gradlew build dockerBuildImage -x test -Poctopus.github.docker.registry=ghcr.io -Pdocker.registry=docker.io -Pversion=${{ github.event.client_payload.project_version }} --info
env:
BUILD_VERSION: ${{ github.event.client_payload.project_version }}
- name: Publish
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion=${{ github.event.client_payload.project_version }}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
BUILD_VERSION: ${{ github.event.client_payload.project_version }}
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to docker registry
run: docker push ghcr.io/octopusden/employee-service:${{ github.event.client_payload.project_version }}
- name: Create Release
uses: marvinpinto/action-automatic-releases@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
automatic_release_tag: v${{ github.event.client_payload.project_version }}
uses: octopusden/octopus-base/.github/workflows/[email protected]
with:
flow-type: hybrid
java-version: '11'
commit-hash: ${{ github.event.client_payload.commit }}
build-version: ${{ github.event.client_payload.project_version }}
docker-image: employee-service
secrets: inherit