diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..183dc2f --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,19 @@ +name: CD + +on: + push: + paths: + - 'VERSION' + +jobs: + release: + uses: jeffersonlab/container-workflows/.github/workflows/gh-release.yaml@v2 + secrets: inherit + + docker_publish: + needs: + - release + uses: jeffersonlab/container-workflows/.github/workflows/docker-publish.yaml@v2 + with: + semvertag: ${{ needs.release.outputs.semvertag }} + secrets: inherit diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1cef97b --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: [ main ] + paths-ignore: + - 'VERSION' + tags-ignore: + - "v*.*.*" + pull_request: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - name: Checkout Project + uses: actions/checkout@v3 + - name: Run Docker Build + run: docker build . diff --git a/.github/workflows/dd.yaml b/.github/workflows/dd.yaml new file mode 100644 index 0000000..50ec079 --- /dev/null +++ b/.github/workflows/dd.yaml @@ -0,0 +1,13 @@ +name: DD +on: + workflow_dispatch: + push: + branches: + - main + paths: + - README.md + - .github/workflows/dd.yaml +jobs: + description: + uses: jeffersonlab/container-workflows/.github/workflows/docker-description.yaml@v2 + 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 f185b45..0000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,42 +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: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - 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 }} \ No newline at end of file diff --git a/README.md b/README.md index a7e275d..e2e494a 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Environment variables: | KC_BOOTSTRAP_ADMIN_PASSWORD | Admin password | ## Release -1. Create a new release on the GitHub Releases page. The release should enumerate changes and link issues. -1. [Publish to DockerHub](https://github.com/JeffersonLab/keycloak/actions/workflows/docker-publish.yml) GitHub Action should run automatically. -1. Bump and commit quick start [image version](https://github.com/JeffersonLab/keycloak/blob/main/compose.override.yaml). +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/keycloak/blob/main/.github/workflows/cd.yaml) GitHub Action should run automatically invoking: + - The [Create release](https://github.com/JeffersonLab/container-workflows/blob/main/.github/workflows/gh-release.yaml) 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.yaml) GitHub Action to create a new demo Docker image. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8cfbc90 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.1.1 \ No newline at end of file