Skip to content

Commit

Permalink
Add callable workflows to build apps in dev and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
kilemensi committed Oct 7, 2024
1 parent 82ffb72 commit 9ac5eff
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/_cd-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: DEV | CD

on:
workflow_call:

jobs:
apps-path-filter:
name:
uses: ./.github/workflows/_app-path-filter.yaml

cd-dev-charterafrica:
needs:
- apps-path-filter
if: ${{ needs.apps-path-filter.outputs.charterafrica == 'true' }}
uses: ./.github/workflows/_cd-codeforafrica.yaml
with:
NODE_ENV: "development"
app_url: "https://charterafrica.dev.codeforafrica.org"
git_remote_url: "ssh://[email protected]/charterafrica-ui"
tags: "codeforafrica/charterafrica-ui:${{ github.sha }}"
secrets: inherit

cd-dev-codeforafrica:
needs:
- apps-path-filter
if: ${{ needs.apps-path-filter.outputs.codeforafrica == 'true' }}
uses: ./.github/workflows/_cd-codeforafrica.yaml
with:
NODE_ENV: "development"
app_url: "https://codeforafrica-ui.dev.codeforafrica.org"
git_remote_url: "ssh://[email protected]/codeofrafrica-ui"
tags: "codeforafrica/codeforafrica-ui:${{ github.sha }}"
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/_cd-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: PROD | CD

on:
workflow_call:

jobs:
version-check-charterafrica:
name: Version Check | charterafrica
uses: ./.github/workflows/_app-version-check.yaml
with:
file-name: "./apps/charterafrica/package.json"

version-check-codeforafrica:
name: Version Check | codeforafrica
uses: ./.github/workflows/_app-version-check.yaml
with:
file-name: "./apps/codeforafrica/package.json"

prod-cd-charterafrica:
name: Deploy | charterafrica
needs:
- version-check-charterafrica
if: ${{ needs.version-check-charterafrica.outputs.changed == 'true' }}
uses: ./.github/workflows/_cd-charterafrica.yaml
with:
NODE_ENV: production
app_url: https://charter.africa
git_remote_url: ssh://[email protected]/charterafrica-ui
tags: "codeforafrica/charterafrica-ui:${{ needs.version-check-charterafrica.outputs.version }}"
secrets: inherit

prod-cd-codeforafrica:
name: Deploy | charterafrica
needs:
- version-check-codeforafrica
if: ${{ needs.version-check-codeforafrica.outputs.changed == 'true' }}
uses: ./.github/workflows/_cd-codeforafrica.yaml
with:
NODE_ENV: production
app_url: https://cfa.dev.codeforafrica.org
git_remote_url: ssh://[email protected]/codeforafrica-ui
tags: "codeforafrica/codeforafrica-ui:${{ needs.version-check-codeforafrica.outputs.version }}"
secrets: inherit

0 comments on commit 9ac5eff

Please sign in to comment.