diff --git a/.github/workflows/deploy-frontend-prod.yml b/.github/workflows/deploy-frontend-prod.yml index ad199d4f6..ef079df49 100644 --- a/.github/workflows/deploy-frontend-prod.yml +++ b/.github/workflows/deploy-frontend-prod.yml @@ -25,7 +25,7 @@ jobs: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-frontend-access aws-region: ap-south-1 - - name: Build frontend and push on ECR + - name: Build frontend and copy to S3 run: | cd nuxt-frontend sed -i "s|VITE_IFRAMELY_KEY_VALUE|${{ secrets.IFRAMELY_KEY }}|g" config.prod.js diff --git a/db/sql.go b/db/sql.go index 06db215af..b21381228 100644 --- a/db/sql.go +++ b/db/sql.go @@ -51,7 +51,7 @@ func NewSql() *sqlx.DB { sslmode = "disable" } - db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"?sslmode="+sslmode) + db = sqlx.MustConnect("postgres", "postgres://"+username+":"+password+"@"+host+":"+port+"/"+name+"?sslmode="+sslmode) db.Mapper = reflectx.NewMapperFunc("json", strings.ToLower) db.SetConnMaxLifetime(time.Minute * 1) diff --git a/jobs/jobs.go b/jobs/jobs.go index 3b9097ed5..21925bf5c 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -186,7 +186,7 @@ func (repository *CareerRepository) SaveApplicationsData(c *gin.Context) { func (repository *CareerRepository) InsertJobApplication(input JobsApplicationsDetails) error { // Upload resume to S3 - resumeURL, err := utils.UploadResumeToS3(input.File) + resumeURL, err := utils.UploadResumeToS3(input.File, input.Email) if err != nil { log.Error(err) return err diff --git a/utils/s3.go b/utils/s3.go index 67606edd2..45f61a131 100644 --- a/utils/s3.go +++ b/utils/s3.go @@ -99,7 +99,7 @@ func UploadFileToS3(fileName string, sess *session.Session) { return } -func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) { +func UploadResumeToS3(fileHeader *multipart.FileHeader, email string) (string, error) { file, err := fileHeader.Open() if err != nil { return "", err @@ -118,7 +118,7 @@ func UploadResumeToS3(fileHeader *multipart.FileHeader) (string, error) { params := &s3.PutObjectInput{ Bucket: aws.String("canopas-website"), - Key: aws.String("resumes/" + fileName), + Key: aws.String("resumes/" + email + "_" + fileName), Body: file, ACL: aws.String("public-read"), }