Skip to content

Commit

Permalink
Updated GitHub Actions
Browse files Browse the repository at this point in the history
Updated GitHub Actions
  • Loading branch information
amithkoujalgi committed Nov 8, 2024
1 parent 874e044 commit 659b610
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 92 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/push-docker-image.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Release Artifacts

on:
push:
tags:
- '**'

permissions:
contents: read
id-token: write
packages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-publish-jar:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write
repository-projects: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build with Maven
run: mvn -B -Drevision=${{ env.RELEASE_VERSION }} clean package --file pom.xml -Pproduction

- name: Release Assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/*.jar

build-and-push-docker-image:
runs-on: ubuntu-latest

needs:
- build-and-publish-jar

permissions:
contents: write
pull-requests: write
repository-projects: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build with Maven
run: mvn -B -Drevision=${{ env.RELEASE_VERSION }} clean package --file pom.xml -Pproduction

- name: Log in to Docker Hub
run: docker login -u amithkoujalgi -p ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
if: startsWith(github.ref, 'refs/tags/')
with:
context: .
file: Dockerfile
push: true
tags: amithkoujalgi/ollama4j-web-ui:${{ env.RELEASE_VERSION }}
45 changes: 0 additions & 45 deletions .github/workflows/release-jar.yml

This file was deleted.

0 comments on commit 659b610

Please # to comment.