diff --git a/.github/workflows/cd-build.yaml b/.github/workflows/cd-build.yaml index e52eba9d7..cc00898f0 100644 --- a/.github/workflows/cd-build.yaml +++ b/.github/workflows/cd-build.yaml @@ -21,19 +21,26 @@ jobs: image: [backend, frontend] steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and Push Image with Tag - run: | - docker build --no-cache --platform=linux/amd64 --target ${{ matrix.image }}-prod --tag "${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:${{ inputs.image_tag }}" . - docker push "${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:${{ inputs.image_tag }}" + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Push + uses: docker/build-push-action@v6 + with: + target: ${{ matrix.image }}-prod + tags: ${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:${{ inputs.image_tag }} + cache-from: | + type=registry,ref=${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:${{ inputs.image_tag }}-cache + type=registry,ref=${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:prod-cache + cache-to: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/bt-${{ matrix.image }}:${{ inputs.image_tag }}-cache,mode=max + platforms: linux/amd64 + push: true build-push-chart: name: Build and Push Helm Chart diff --git a/.github/workflows/cd-deploy-docs.yaml b/.github/workflows/cd-deploy-docs.yaml index 8fa491b37..143a82752 100644 --- a/.github/workflows/cd-deploy-docs.yaml +++ b/.github/workflows/cd-deploy-docs.yaml @@ -45,7 +45,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push + - name: Build and Push uses: docker/build-push-action@v6 with: context: docs @@ -89,3 +89,7 @@ jobs: # Check container status kubectl rollout status --timeout=180s deployment bt-prod-docs-docs + + - name: Output Summary + run: | + echo "# :white_check_mark: Deployment available at [docs.stanfurdtime.com](https://docs.stanfurdtime.com)." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/cd-deploy.yaml b/.github/workflows/cd-deploy.yaml index d3bc05543..f5b6985c9 100644 --- a/.github/workflows/cd-deploy.yaml +++ b/.github/workflows/cd-deploy.yaml @@ -15,6 +15,10 @@ on: description: "Helm chart version" required: true type: string + host: + description: "Hostname for the deployment" + required: true + type: string values: description: "Helm chart override values (yaml)" required: true @@ -55,3 +59,7 @@ jobs: # Check container status kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-backend kubectl rollout status --timeout=180s deployment ${{ inputs.name }}-frontend + + - name: Output Summary + run: | + echo "# :white_check_mark: Deployment available at [${{ inputs.host }}](https://${{ inputs.host }})." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/cd-dev.yaml b/.github/workflows/cd-dev.yaml index 48a496eb9..51a9c3181 100644 --- a/.github/workflows/cd-dev.yaml +++ b/.github/workflows/cd-dev.yaml @@ -58,6 +58,7 @@ jobs: host: ${{ needs.compute-sha.outputs.sha_short }}.dev.stanfurdtime.com mongoUri: mongodb://bt-dev-mongo-mongodb-0.bt-dev-mongo-mongodb-headless.bt.svc.cluster.local:27017/bt redisUri: redis://bt-dev-redis-master.bt.svc.cluster.local:6379 + host: ${{ needs.compute-sha.outputs.sha_short }}.dev.stanfurdtime.com secrets: inherit limit-deploy: diff --git a/.github/workflows/cd-prod.yaml b/.github/workflows/cd-prod.yaml index 08a150667..bffb1509c 100644 --- a/.github/workflows/cd-prod.yaml +++ b/.github/workflows/cd-prod.yaml @@ -34,4 +34,5 @@ jobs: version: "1.0.0" values: | host: stanfurdtime.com + host: stanfurdtime.com secrets: inherit diff --git a/.github/workflows/cd-stage.yaml b/.github/workflows/cd-stage.yaml index 776125663..26f23c485 100644 --- a/.github/workflows/cd-stage.yaml +++ b/.github/workflows/cd-stage.yaml @@ -34,5 +34,6 @@ jobs: host: staging.stanfurdtime.com mongoUri: mongodb://bt-stage-mongo-mongodb.bt.svc.cluster.local:27017/bt redisUri: redis://bt-stage-redis-master.bt.svc.cluster.local:6379 + host: staging.stanfurdtime.com # TODO(core): change mongoUri to replicaset secrets: inherit diff --git a/docs/src/core/infrastructure/cicd-workflow.md b/docs/src/core/infrastructure/cicd-workflow.md index e18f68faf..47046ca6f 100644 --- a/docs/src/core/infrastructure/cicd-workflow.md +++ b/docs/src/core/infrastructure/cicd-workflow.md @@ -23,4 +23,3 @@ The differences between the three environments are managed by each individual wo [^2]: Development, Staging, and Production [^3]: Ideally, these would follow [semantic versioning](https://semver.org/), but this is rather difficult to enforce and automate. - diff --git a/docs/src/core/infrastructure/assets/cicd-dev-1.png b/docs/src/getting-started/assets/cicd-dev-1.png similarity index 100% rename from docs/src/core/infrastructure/assets/cicd-dev-1.png rename to docs/src/getting-started/assets/cicd-dev-1.png diff --git a/docs/src/core/infrastructure/assets/cicd-dev-2.png b/docs/src/getting-started/assets/cicd-dev-2.png similarity index 100% rename from docs/src/core/infrastructure/assets/cicd-dev-2.png rename to docs/src/getting-started/assets/cicd-dev-2.png diff --git a/docs/src/core/infrastructure/assets/cicd-dev-3.png b/docs/src/getting-started/assets/cicd-dev-3.png similarity index 100% rename from docs/src/core/infrastructure/assets/cicd-dev-3.png rename to docs/src/getting-started/assets/cicd-dev-3.png diff --git a/docs/src/core/infrastructure/assets/cicd-dev-4.png b/docs/src/getting-started/assets/cicd-dev-4.png similarity index 100% rename from docs/src/core/infrastructure/assets/cicd-dev-4.png rename to docs/src/getting-started/assets/cicd-dev-4.png diff --git a/docs/src/core/infrastructure/assets/cicd-dev-5.png b/docs/src/getting-started/assets/cicd-dev-5.png similarity index 100% rename from docs/src/core/infrastructure/assets/cicd-dev-5.png rename to docs/src/getting-started/assets/cicd-dev-5.png diff --git a/docs/src/getting-started/assets/cicd-dev-6.png b/docs/src/getting-started/assets/cicd-dev-6.png new file mode 100644 index 000000000..8b17c1bff Binary files /dev/null and b/docs/src/getting-started/assets/cicd-dev-6.png differ diff --git a/docs/src/getting-started/deployment-with-cicd.md b/docs/src/getting-started/deployment-with-cicd.md index e7d43fa75..ae8dc01d8 100644 --- a/docs/src/getting-started/deployment-with-cicd.md +++ b/docs/src/getting-started/deployment-with-cicd.md @@ -37,7 +37,7 @@ The deployment process is different for [development](#development), [staging](# -5. After the action succeeds, go to `www.abcdefg.dev.stanfurdtime.com`, where `abcdefg` is the first 7 characters of the latest commit's hash. This is also shown on the summary tab of an action workflow. +5. After the action succeeds, go to `www.abcdefg.dev.stanfurdtime.com`, where `abcdefg` is the first 7 characters of the latest commit's hash. This is also shown on the summary tab of an action workflow. A hyperlink to the deployment is also available near the bottom of the Summary page of the workflow run.
Example Success Deployment Log @@ -68,6 +68,8 @@ The deployment process is different for [development](#development), [staging](# =============================================== ``` + ![Deploy to Development Link](./assets/cicd-dev-6.png) +
## Staging