Skip to content

Commit

Permalink
bump actions
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Mar 14, 2024
1 parent 0ac692b commit 537fe0d
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 29 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@ name: CI
on:
push:
branches: [ main ]
paths-ignore:
- 'VERSION'
tags-ignore:
- "v*.*.*"
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
- name: Build with Gradle
run: ./gradlew build
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build with Gradle
run: ./gradlew build
5 changes: 3 additions & 2 deletions .github/workflows/docker-description.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Update DockerHub Description
on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -10,10 +11,10 @@ jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
name: Publish to DockerHub

on:
release:
types: [published]
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
jeffersonlab/${{ github.event.repository.name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{version}},event=release
type=semver,pattern={{version}},event=workflow_dispatch
type=semver,pattern={{version}},event=workflow_call,value=${{ inputs.semvertag }}
-
name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Push to Docker Hub
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
push: true
build-args: |
CUSTOM_CRT_URL=http://pki.jlab.org/JLabCA.crt
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Update demo version
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git fetch origin main
git checkout main
sed -i -E 's/[0-9]+(\.[0-9]+)*/${{ steps.meta.outputs.version }}/' compose.override.yaml
git commit -am "Bump demo compose version to ${{ steps.meta.outputs.version }}"
git push
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
paths:
- 'VERSION'

jobs:
release:
runs-on: ubuntu-latest
outputs:
semvertag: ${{ steps.getver.outputs.semvertag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Build
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: Build with Gradle
run: ./gradlew build
- name: Read version file
id: getver
run: |
VER=$(cat VERSION)
echo "VERSION=v$VER" >> $GITHUB_ENV
echo "semvertag=v$VER" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: build/libs/${{ github.event.repository.name }}.war
tag_name: ${{ env.VERSION }}

docker_publish:
needs:
- release
uses: jeffersonlab/${{ github.event.repository.name }}/.github/workflows/docker-publish.yml@main
with:
semvertag: ${{ needs.release.outputs.semvertag }}
secrets: inherit

0 comments on commit 537fe0d

Please sign in to comment.