From e870028549ae5f78ddc2aa243b3f28ab701840dd Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Tue, 8 Oct 2024 09:32:02 +0300 Subject: [PATCH] Clean up --- .github/workflows/_cd-charterafrica.yaml | 15 +++++----- .github/workflows/_cd-codeforafrica.yaml | 11 +++---- .github/workflows/main.yaml | 5 ++-- .github/workflows/pr.yaml | 37 ++++++++++++------------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/_cd-charterafrica.yaml b/.github/workflows/_cd-charterafrica.yaml index 9634bed79..3029b3158 100644 --- a/.github/workflows/_cd-charterafrica.yaml +++ b/.github/workflows/_cd-charterafrica.yaml @@ -30,17 +30,18 @@ on: jobs: # This seem to be needed because GitHub doesn't support access `secrets` in a `with` clause + # when calling reusable workflows # https://github.com/github/roadmap/issues/636 secrets: runs-on: ubuntu-latest outputs: - MONGO_URL: ${{ steps.output-secrets.outputs.test.CHARTERAFRICA_MONGO_URL }} - NEXT_PUBLIC_APP_LOGO_URL: ${{ steps.output-secrets.outputs.test.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} - NEXT_PUBLIC_APP_NAME: ${{ steps.output-secrets.outputs.test.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} - NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ steps.output-secrets.outputs.test.CHARTERAFRICA_GA_MEASUREMENT_ID }} - NEXT_PUBLIC_SENTRY_DSN: ${{ steps.output-secrets.outputs.test.CHARTERAFRICA_SENTRY_DSN }} - PAYLOAD_SECRET: ${{ steps.output-secrets.outputs.test.CHARTERAFRICA_PAYLOAD_SECRET_KEY }} - SENTRY_PROJECT: ${{ steps.output-secrets.outputs.test.CODEFORAFRICA_SENTRY_PROJECT }} + MONGO_URL: ${{ steps.output-secrets.outputs.CHARTERAFRICA_MONGO_URL }} + NEXT_PUBLIC_APP_LOGO_URL: ${{ steps.output-secrets.outputs.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} + NEXT_PUBLIC_APP_NAME: ${{ steps.output-secrets.outputs.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} + NEXT_PUBLIC_GA_MEASUREMENT_ID: ${{ steps.output-secrets.outputs.CHARTERAFRICA_GA_MEASUREMENT_ID }} + NEXT_PUBLIC_SENTRY_DSN: ${{ steps.output-secrets.outputs.CHARTERAFRICA_SENTRY_DSN }} + PAYLOAD_SECRET: ${{ steps.output-secrets.outputs.CHARTERAFRICA_PAYLOAD_SECRET_KEY }} + SENTRY_PROJECT: ${{ steps.output-secrets.outputs.CODEFORAFRICA_SENTRY_PROJECT }} steps: - id: output-secrets run: | diff --git a/.github/workflows/_cd-codeforafrica.yaml b/.github/workflows/_cd-codeforafrica.yaml index 18387820b..dd76dd3fb 100644 --- a/.github/workflows/_cd-codeforafrica.yaml +++ b/.github/workflows/_cd-codeforafrica.yaml @@ -31,15 +31,16 @@ on: jobs: # This seem to be needed because GitHub doesn't support access `secrets` in a `with` clause + # when calling reusable workflows # https://github.com/github/roadmap/issues/636 secrets: runs-on: ubuntu-latest outputs: - MONGODB_URL: ${{ steps.output-secrets.outputs.test.CODEFORAFRICA_MONGODB_URL }} - NEXT_PUBLIC_APP_LOGO_URL: ${{ steps.output-secrets.outputs.test.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} - NEXT_PUBLIC_APP_NAME: ${{ steps.output-secrets.outputs.test.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} - PAYLOAD_SECRET: ${{ steps.output-secrets.outputs.test.CODEFORAFRICA_PAYLOAD_SECRET }} - SENTRY_PROJECT: ${{ steps.output-secrets.outputs.test.CODEFORAFRICA_SENTRY_PROJECT }} + MONGODB_URL: ${{ steps.output-secrets.outputs.CODEFORAFRICA_MONGODB_URL }} + NEXT_PUBLIC_APP_LOGO_URL: ${{ steps.output-secrets.outputs.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }} + NEXT_PUBLIC_APP_NAME: ${{ steps.output-secrets.outputs.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }} + PAYLOAD_SECRET: ${{ steps.output-secrets.outputs.CODEFORAFRICA_PAYLOAD_SECRET }} + SENTRY_PROJECT: ${{ steps.output-secrets.outputs.CODEFORAFRICA_SENTRY_PROJECT }} steps: - id: output-secrets run: | diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 51c304a47..fe4f7c8ce 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,8 +1,8 @@ name: CI/CD [Main] on: - pull_request: - branches: # PRs to the following branches will trigger the workflow + push: + branches: - main paths: - ".github/workflows/**" @@ -21,7 +21,6 @@ jobs: uses: ./.github/workflows/_ci.yaml apps-path-filter: - name: uses: ./.github/workflows/_app-path-filter.yaml secrets: inherit diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index ed0bb8fa7..043768625 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -1,22 +1,21 @@ -# name: CI [PR] +name: CI/CD [PR] -# on: -# pull_request: -# branches: # PRs to the following branches will trigger the workflow -# - main -# paths: -# - ".github/workflows/**" -# - "apps/**" -# - "packages/**" +on: + pull_request: + branches: # PRs to the following branches will trigger the workflow + - main + paths: + - ".github/workflows/**" + - "apps/**" + - "packages/**" -# # This allows a subsequently queued workflow run to interrupt previous runs -# concurrency: -# group: "${{ github.workflow }} @ ${{ github.ref }}" -# cancel-in-progress: true +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: "${{ github.workflow }} @ ${{ github.ref }}" + cancel-in-progress: true -# jobs: -# ci: -# name: CI -# uses: ./.github/workflows/_ci.yaml - -# # TODO: deploy Dokku preview apps here +jobs: + ci: + name: CI + uses: ./.github/workflows/_ci.yaml +# TODO: deploy Dokku preview apps here