diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..30ec2b7 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,21 @@ +name: CD + +on: + push: + paths: + - 'VERSION' + +jobs: + release: + uses: jeffersonlab/java-workflows/.github/workflows/gh-release.yml@main + with: + files: build/libs/srm.war + secrets: inherit + + docker_publish: + needs: + - release + uses: jeffersonlab/container-workflows/.github/workflows/docker-publish.yml@main + with: + semvertag: ${{ needs.release.outputs.semvertag }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d68263f..94d599c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,10 @@ name: CI on: push: branches: [ main ] + paths-ignore: + - 'VERSION' + tags-ignore: + - "v*.*.*" pull_request: branches: [ main ] workflow_dispatch: @@ -11,16 +15,5 @@ permissions: contents: read jobs: - ci: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: 17 - - uses: gradle/gradle-build-action@v2 - with: - gradle-version: wrapper - - name: Build with Gradle - run: ./gradlew build + build: + uses: jeffersonlab/java-workflows/.github/workflows/unit-ci.yml@main diff --git a/.github/workflows/docker-description.yml b/.github/workflows/docker-description.yml index aa42c7e..0436642 100644 --- a/.github/workflows/docker-description.yml +++ b/.github/workflows/docker-description.yml @@ -9,14 +9,8 @@ on: - .github/workflows/docker-description.yml jobs: dockerHubDescription: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Docker Hub Description - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: jeffersonlab/${{ github.event.repository.name }} - short-description: ${{ github.event.repository.description }} \ No newline at end of file + uses: jeffersonlab/container-workflows/.github/workflows/docker-description.yml@main + with: + repository: jeffersonlab/${{ github.event.repository.name }} + description: ${{ github.event.repository.description }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index a44b227..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,39 +0,0 @@ -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 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - jeffersonlab/${{ github.event.repository.name }} - tags: | - type=semver,pattern={{version}} - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub - uses: docker/build-push-action@v3 - with: - push: true - build-args: | - CUSTOM_CRT_URL=http://pki.jlab.org/JLabCA.crt - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file