From 8eb8233c1a20d7b2a50da4ea6a2c4c38b6233187 Mon Sep 17 00:00:00 2001 From: Paige Williams Date: Wed, 17 Jun 2026 10:13:17 -0700 Subject: [PATCH 1/4] publish docker images to ghcr on release published --- .../create-and-publish-docker-images.yml | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create-and-publish-docker-images.yml b/.github/workflows/create-and-publish-docker-images.yml index c6dc797f..3f98fc6f 100644 --- a/.github/workflows/create-and-publish-docker-images.yml +++ b/.github/workflows/create-and-publish-docker-images.yml @@ -3,14 +3,19 @@ name: Create and publish web and proxy Docker images # manually trigger while testing on: - push: - branches: - - main + release: + types: [published] workflow_dispatch: -# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and the tags on the web and proxy image. env: REGISTRY: ghcr.io + METADATA_TAGS: &metadata-tags | + type=sha + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=v{{major}} + type=raw,latest jobs: build-and-push-image: @@ -36,11 +41,20 @@ jobs: run: | IMAGE_NAME=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]') echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV - - name: Extract metadata (tags, labels) for Docker - id: meta + + - name: Extract metadata (tags, labels) for Docker Web Image + id: meta-web + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/web + tags: *metadata-tags + + - name: Extract metadata (tags, labels) for Docker Proxy Image + id: meta-proxy uses: docker/metadata-action@v5 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/proxy + tags: *metadata-tags # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository. # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. @@ -55,8 +69,8 @@ jobs: context: ./TEKDB file: ./TEKDB/Dockerfile push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/web:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/web:${{ github.sha }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-web.outputs.tags }} + labels: ${{ steps.meta-web.outputs.labels }} cache-from: type=gha,scope=ghcr-web cache-to: type=gha,mode=max,scope=ghcr-web @@ -67,8 +81,8 @@ jobs: context: ./proxy file: ./proxy/Dockerfile push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/proxy:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/proxy:${{ github.sha }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-proxy.outputs.tags }} + labels: ${{ steps.meta-proxy.outputs.labels }} cache-from: type=gha,scope=ghcr-proxy cache-to: type=gha,mode=max,scope=ghcr-proxy From 3433b53caf171c96a94a1ca581c58fba595c39f6 Mon Sep 17 00:00:00 2001 From: Paige Williams Date: Wed, 17 Jun 2026 12:45:50 -0700 Subject: [PATCH 2/4] add mermaid chart for development lifecycle --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6ab8a5e..7bee57cc 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,39 @@ -# TEKDB +# TEKDB ![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/paigewilliams/9ac2331c0af09d1f4fc3921a2c2cd142/raw/coverage-badge.json) + Traditional Ecological Knowledge Ethnographic Database Application ## [Development Installation](https://github.com/Ecotrust/TEKDB/wiki/Development-Installation) ## [Running Tests](https://github.com/Ecotrust/TEKDB/wiki/Running-tests) -![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/paigewilliams/9ac2331c0af09d1f4fc3921a2c2cd142/raw/coverage-badge.json) \ No newline at end of file +## CI/CD + +This project has a few Github actions that run to have continous integration / continuous deployment with our environments. Below is a diagram on the path to production: + +```mermaid +flowchart TB + subgraph Develop + CHECKOUT[checkout develop branch] --> FEAT[Create feature Branch] + FEAT --> PR[Submit Pull Request against develop branch] + PR --> APPROVE{Approval} + APPROVE -->|Approved| DEVMERGE[Merge into develop branch] + APPROVE -->|Rejected| REJECTED[Address feedback] + REJECTED --> APPROVE + end + + subgraph Staging + DEVMERGE --> GHSTAGE[Github Action deploys to staging.itkdb.org] + GHSTAGE --> QA[QA on staging environment] + QA --> QAPASS{Passes QA} + QAPASS -->|PASSES| PRVERSION[Create PR to update version in settings.py] + QAPASS -->|FAILS| FEAT + PRVERSION --> PRDEV[Merge into develop branch] + end + + subgraph Production + PRDEV --> PRMAIN[PR for develop into main] + PRMAIN --> RELEASE[Publish a new Release] + RELEASE --> GHPROD[Github Action builds and publishes images to GHCR] + GHPROD --> PRODDEPLOY[Manually deploy to demo.itkdb.org] + end +``` From 319a8bd7257386285ddbb8a2c05938ea6f6c0c2a Mon Sep 17 00:00:00 2001 From: Paige Williams Date: Wed, 17 Jun 2026 13:16:19 -0700 Subject: [PATCH 3/4] add to mermaid diagram for hotfix flow --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7bee57cc..a72b18b2 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Traditional Ecological Knowledge Ethnographic Database Application ## [Running Tests](https://github.com/Ecotrust/TEKDB/wiki/Running-tests) -## CI/CD +## Development Cycle -This project has a few Github actions that run to have continous integration / continuous deployment with our environments. Below is a diagram on the path to production: +This project aims to follow a specific development cycle to ease collaboration and keep the different environments in sync. Below is a diagram on what the development lifecycle should look like: ```mermaid flowchart TB @@ -25,15 +25,26 @@ flowchart TB DEVMERGE --> GHSTAGE[Github Action deploys to staging.itkdb.org] GHSTAGE --> QA[QA on staging environment] QA --> QAPASS{Passes QA} - QAPASS -->|PASSES| PRVERSION[Create PR to update version in settings.py] - QAPASS -->|FAILS| FEAT - PRVERSION --> PRDEV[Merge into develop branch] end subgraph Production + QAPASS -->|PASSES| PRVERSION[Create feature branch and open PR to update version in settings.py] + QAPASS -->|FAILS| FEAT + PRVERSION --> PRDEV[Merge into develop branch] PRDEV --> PRMAIN[PR for develop into main] - PRMAIN --> RELEASE[Publish a new Release] + PRMAIN --> PRMERGEMAIN[Merge into main branch] + PRMERGEMAIN --> RELEASE[Publish a new Release] RELEASE --> GHPROD[Github Action builds and publishes images to GHCR] GHPROD --> PRODDEPLOY[Manually deploy to demo.itkdb.org] + PRODDEPLOY --> QAPROD[Test in production] + QAPROD --> QAPASSPROD{Passes QA} + QAPASSPROD --> |PASSES| SUCCESS[Success!] + QAPASSPROD --> |Fails| HOTFIX[Create a hotfix branch off of main] + HOTFIX --> PRHOTFIX[PR for hotfix into main] + PRHOTFIX --> APPROVEHOTFIX{Approval} + APPROVEHOTFIX --> |Approval| MERGEHOTFIX[Merge into main branch] + APPROVEHOTFIX --> |Rejected| REJECTEDHOTFIX[Address feedback] + REJECTEDHOTFIX --> APPROVEHOTFIX + MERGEHOTFIX --> RELEASE end ``` From b40d5b49d24c55499191b58a4380133836bfe585 Mon Sep 17 00:00:00 2001 From: Paige Williams Date: Wed, 17 Jun 2026 13:51:06 -0700 Subject: [PATCH 4/4] minor readme grammar changes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a72b18b2..9631d10f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Traditional Ecological Knowledge Ethnographic Database Application ## Development Cycle -This project aims to follow a specific development cycle to ease collaboration and keep the different environments in sync. Below is a diagram on what the development lifecycle should look like: +This project aims to follow a specific development cycle to ease collaboration and keep the different environments in sync. Below is a diagram of what the development lifecycle should look like: ```mermaid flowchart TB @@ -22,7 +22,7 @@ flowchart TB end subgraph Staging - DEVMERGE --> GHSTAGE[Github Action deploys to staging.itkdb.org] + DEVMERGE --> GHSTAGE[GitHub Action deploys to staging.itkdb.org] GHSTAGE --> QA[QA on staging environment] QA --> QAPASS{Passes QA} end @@ -34,7 +34,7 @@ flowchart TB PRDEV --> PRMAIN[PR for develop into main] PRMAIN --> PRMERGEMAIN[Merge into main branch] PRMERGEMAIN --> RELEASE[Publish a new Release] - RELEASE --> GHPROD[Github Action builds and publishes images to GHCR] + RELEASE --> GHPROD[GitHub Action builds and publishes images to GHCR] GHPROD --> PRODDEPLOY[Manually deploy to demo.itkdb.org] PRODDEPLOY --> QAPROD[Test in production] QAPROD --> QAPASSPROD{Passes QA}