-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6d5923
commit 457992e
Showing
3 changed files
with
154 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
versionModifier: | ||
description: 'Version Modifier' | ||
default: 'patch' | ||
type: choice | ||
required: false | ||
options: | ||
- 'patch' | ||
- 'minor' | ||
- 'major' | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Build with Gradle | ||
run: ./gradlew -i clean build --refresh-dependencies :generateVersionFile githubRelease | ||
if: ${{ github.ref_name == 'main' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Outputs | ||
run: |- | ||
echo "::set-output name=semVersion::$(cat build/semver/version.txt | head -1)" | ||
echo "::set-output name=semVersionTag::$(cat build/semver/version.txt | tail -1)" | ||
id: ci-release-create-outputs | ||
shell: bash | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=provenanceio/p8e-cee-api | ||
VERSION={{ steps.ci-release-create-outputs.outputs.semVersion }} | ||
TAGS=${{ steps.ci-release-create-outputs.outputs.semVersionTag }} | ||
echo ::set-output name=version::${VERSION} | ||
echo ::set-output name=tags::${TAGS} | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push service docker | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: service/docker/Dockerfile | ||
context: . | ||
push: true | ||
tags: ${{ steps.prep.outputs.tags }} |
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