Skip to content

Commit

Permalink
clone db before docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Sep 15, 2023
1 parent 5ca44ff commit 2069047
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/codeforafrica-deploy-review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ jobs:
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKER_HUB_USERNAME }}

- name: Build Docker image
uses: docker/build-push-action@v3
with:
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 }}
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 }}
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 }}:${{ github.sha }}"

- name: Push to dokku
uses: dokku/github-action@master
with:
Expand All @@ -89,6 +71,24 @@ jobs:
|-------|--------|
| ${{ env.APP_NAME }} | [Visit](https://${{ env.APP_NAME }}.dev.codeforafrica.org) |
- name: Build Docker image
uses: docker/build-push-action@v3
with:
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 }}
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 }}
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 }}:${{ github.sha }}"

destroy_review_app:
runs-on: ubuntu-latest
# only run when a pull request is closed
Expand Down

0 comments on commit 2069047

Please sign in to comment.