From 8afd297fcdf83e91db39ade8e6fd779ec7f32d54 Mon Sep 17 00:00:00 2001 From: slominskir Date: Wed, 15 May 2024 15:31:15 -0400 Subject: [PATCH] workflow updates [no ci] --- .github/workflows/cd.yml | 19 ++++++++++++ .github/workflows/ci.yml | 4 +++ .github/workflows/dd.yml | 13 +++++++++ .github/workflows/docker-description.yml | 22 -------------- .github/workflows/docker-publish.yml | 37 ------------------------ README.md | 6 ++-- VERSION | 1 + 7 files changed, 41 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/dd.yml delete mode 100644 .github/workflows/docker-description.yml delete mode 100644 .github/workflows/docker-publish.yml create mode 100644 VERSION diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..cb18393 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,19 @@ +name: CD + +on: + push: + paths: + - 'VERSION' + +jobs: + release: + uses: jeffersonlab/container-workflows/.github/workflows/gh-release.yml@v1 + secrets: inherit + + docker_publish: + needs: + - release + uses: jeffersonlab/container-workflows/.github/workflows/docker-publish.yml@v1 + with: + semvertag: ${{ needs.release.outputs.semvertag }} + secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1231892..1cef97b 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: diff --git a/.github/workflows/dd.yml b/.github/workflows/dd.yml new file mode 100644 index 0000000..9d3d42b --- /dev/null +++ b/.github/workflows/dd.yml @@ -0,0 +1,13 @@ +name: DD +on: + workflow_dispatch: + push: + branches: + - main + paths: + - README.md + - .github/workflows/dd.yml +jobs: + description: + uses: jeffersonlab/container-workflows/.github/workflows/docker-description.yml@v1 + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/docker-description.yml b/.github/workflows/docker-description.yml deleted file mode 100644 index aa42c7e..0000000 --- a/.github/workflows/docker-description.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Update DockerHub Description -on: - workflow_dispatch: - push: - branches: - - main - paths: - - README.md - - .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 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index e93536c..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,37 +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 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index 61df461..4331820 100644 --- a/README.md +++ b/README.md @@ -98,5 +98,7 @@ These environment variables are Docker specific and are used by the [docker-entr **Note**: The entrypoint script waits for either an Oracle or a MariaDB database to start but not both. Oracle takes precedence. ## Release -1. Create a new release on the GitHub Releases page. The release should enumerate changes and link issues. -2. Build and publish a new Docker image [from the GitHub tag](https://gist.github.com/slominskir/a7da801e8259f5974c978f9c3091d52c#8-build-an-image-based-of-github-tag). GitHub is configured to do this automatically on git push of semver tag (typically part of GitHub release) or the [Publish to DockerHub](https://github.com/JeffersonLab/wildfly/actions/workflows/docker-publish.yml) action can be manually triggered after selecting a tag. +1. Bump the version number in the VERSION file and commit and push to GitHub (using [Semantic Versioning](https://semver.org/)). +2. The [CD](https://github.com/JeffersonLab/wildfly/blob/main/.github/workflows/cd.yml) GitHub Action should run automatically invoking: + - The [Create release](https://github.com/JeffersonLab/container-workflows/blob/main/.github/workflows/gh-release.yml) GitHub Action to tag the source and create release notes summarizing any pull requests. Edit the release notes to add any missing details. + - The [Publish docker image](https://github.com/JeffersonLab/container-workflows/blob/main/.github/workflows/docker-publish.yml) GitHub Action to create a new demo Docker image, and bump the [compose.override.yaml](https://github.com/JeffersonLab/wildfly/blob/main/compose.override.yaml) to use the new image. \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3e1ad72 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.5.0 \ No newline at end of file