From 3b87aefcc19fc5c893e82649277245390596dc11 Mon Sep 17 00:00:00 2001 From: ryans Date: Mon, 25 Mar 2024 14:13:39 -0400 Subject: [PATCH] workflow [no ci] --- .github/workflows/cd.yml | 21 ++++++++++ .github/workflows/docker-publish.yml | 61 ---------------------------- .github/workflows/release.yml | 45 -------------------- 3 files changed, 21 insertions(+), 106 deletions(-) create mode 100644 .github/workflows/cd.yml delete mode 100644 .github/workflows/docker-publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..a044780 --- /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/release.yml@main + with: + files: build/libs/btm.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/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 22d5d42..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Publish to DockerHub - -on: - release: - types: [published] - workflow_dispatch: - workflow_call: - inputs: - semvertag: - required: true - type: string - secrets: - DOCKERHUB_USERNAME: - required: true - DOCKERHUB_TOKEN: - required: true - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - jeffersonlab/${{ github.event.repository.name }} - tags: | - 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@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Push to Docker Hub - 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 }} - - - 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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 443975f..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,45 +0,0 @@ -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/btm.war - tag_name: ${{ env.VERSION }} - - docker_publish: - needs: - - release - uses: jeffersonlab/btm/.github/workflows/docker-publish.yml@main - with: - semvertag: ${{ needs.release.outputs.semvertag }} - secrets: inherit \ No newline at end of file