Skip to content

Commit

Permalink
Merge pull request #630 from CodeForAfrica/feature-auto-deploy
Browse files Browse the repository at this point in the history
Deploy to prod
  • Loading branch information
koechkevin committed Oct 10, 2023
2 parents 39694ab + ee1bb68 commit ec8139d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeforafrica-deploy-dev-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ jobs:
build-args: |
MONGODB_URL=${{ secrets.CODEFORAFRICA_MONGO_URL }}/${{ env.APP_NAME }}
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET_KEY }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }}
GHOST_URL=${{ secrets.GHOST_URL }}
GHOST_API_KEY=${{ secrets.GHOST_API_KEY }}
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_APP_CFA_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_APP_CFA_NAME }}
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
context: .
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/codeforafrica-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
APP: "codeforafrica"
VERSION_FILE_NAME: "./apps/codeforafrica/package.json"
GIT_PUSH_FLAGS: "--force"
NEXT_PUBLIC_APP_URL: "https://cfa.dev.codeforafrica.org"

jobs:
deploy:
Expand Down Expand Up @@ -74,12 +75,15 @@ jobs:
uses: docker/build-push-action@v3
with:
build-args: |
APP=${{ env.APP }}
GHOST_API_KEY=${{ secrets.GHOST_API_KEY }}
GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}
MONGODB_URL=${{ secrets.CODEFORAFRICA_MONGODB_URL }}
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }}
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
context: .
file: ./Dockerfile.codeforafrica
push: true
tags: "${{ env.IMAGE_NAME }}:${{ steps.version-check.outputs.version }}"

Expand All @@ -93,7 +97,6 @@ jobs:
if: steps.version-check.outputs.changed == 'true'
uses: dokku/[email protected]
with:
branch: ${{ env.DOKKU_REMOTE_BRANCH }}
deploy_docker_image: ${{ env.IMAGE_NAME }}:${{ steps.version-check.outputs.version }}
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
git_push_flags: ${{ env.GIT_PUSH_FLAGS }}
git_remote_url: ${{ env.DOKKU_REMOTE_URL }}
6 changes: 3 additions & 3 deletions .github/workflows/codeforafrica-deploy-review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ jobs:
build-args: |
MONGODB_URL=${{ secrets.CODEFORAFRICA_MONGO_URL }}/${{ env.APP_NAME }}
NEXT_PUBLIC_APP_URL=${{ env.NEXT_PUBLIC_APP_URL }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET_KEY }}
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_APP_CFA_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_APP_CFA_NAME }}
PAYLOAD_SECRET=${{ secrets.CODEFORAFRICA_PAYLOAD_SECRET }}
NEXT_PUBLIC_APP_LOGO_URL=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_LOGO_URL }}
NEXT_PUBLIC_APP_NAME=${{ secrets.NEXT_PUBLIC_CODEFORAFRICA_APP_NAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
context: .
Expand Down
2 changes: 1 addition & 1 deletion apps/codeforafrica/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeforafrica",
"version": "1.0.40",
"version": "1.0.46",
"private": true,
"author": "Code for Africa <[email protected]>",
"description": "This is the main CFA site.",
Expand Down

0 comments on commit ec8139d

Please sign in to comment.