Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify build fix with prisma field encryption inclusion #65

Merged
merged 14 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.production.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ SHLP_POSTGRES_DB=
SHLP_POSTGRES_USERNAME=
SHLP_POSTGRES_PASSWORD=
POSTGRES_PRISMA_URL=postgresql://${SHLP_POSTGRES_USERNAME}:${SHLP_POSTGRES_PASSWORD}@${SHLP_POSTGRES_HOST}:5432/${SHLP_POSTGRES_DB}
PRISMA_FIELD_ENCRYPTION_KEY=
PRISMA_FIELD_ENCRYPTION_HASH_SALT=
PRISMA_FIELD_ENCRYPTION_KEY=k1.aesgcm256.Wmy6koJaJpjB0H25qBccLfQ84AvpmCjexanqCHJ5Hr0=
PRISMA_FIELD_ENCRYPTION_HASH_SALT=1a4671c31ff22834a56d4f3741aeac8cc8662a11c73802083ea5a118e5ee600e
BMartinos marked this conversation as resolved.
Show resolved Hide resolved
47 changes: 47 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
pull_request:
branches:
- main
- fix/production-build-prisma-field-encryption

jobs:
test:
Expand All @@ -27,6 +28,52 @@ jobs:
- name: Run Jest Tests
run: yarn test --collectCoverage=false

build-and-push:
runs-on: ubuntu-latest
steps:
- name: Get Branch Name
id: get_branch # Add an ID to this step to reference its output
run: |
branch_name=${{ github.head_ref }}

# Sanitize the branch name
sanitized_branch_name=$(echo "$branch_name" | sed -e 's/\//_/g' | tr '[:upper:]' '[:lower:]')

echo "::set-output name=branch_name::$sanitized_branch_name"

- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push tag
if: ${{ steps.get_branch.outputs.branch_name != 'main' }}
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
file: docker/production/Dockerfile
tags: jembi/smart-health-links-portal:${{ steps.get_branch.outputs.branch_name }}

- name: Build and push latest
if: ${{ steps.get_branch.outputs.branch_name == 'main' }}
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not check if it is nit on pull request before we push the image?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacob-khoza-symb Yup thats correct, I still need to make some updates on this action script.
The current changes are just intended for testing purposes to have an image build and sent to dockerhub to verify the build works as intended (without having to merge into master multiple times)

Side note: The entire GHA needs a bit of refactoring and improvement

file: docker/production/Dockerfile
tags: jembi/smart-health-links-portal:latest

# coverage:
# runs-on: ubuntu-latest
# needs: test
Expand Down
Loading