Skip to content

Commit

Permalink
upload env file too
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn committed Nov 13, 2024
1 parent 5ba79b1 commit f4e9c62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
19 changes: 10 additions & 9 deletions .github/actions/deploy/backend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ runs:
with:
go-version: '1.23'

- name: 'Create env file'
- name: Build the app
shell: bash
working-directory: ./go
run: |
go mod download
GOOS=linux go build -o bin/app cmd/main.go
- name: Create env file
working-directory: ./go/bin
shell: bash
run: |
touch .env
Expand All @@ -47,14 +55,7 @@ runs:
echo DB_PASSWORD=${{ inputs.db_password }} >> .env
echo DB_NAME=${{ inputs.db_name }} >> .env
- name: Build the app
shell: bash
working-directory: ./go
run: |
go mod download
GOOS=linux go build -o bin/app cmd/main.go
- name: Deploy to my EC2 instance
- name: Deploy to EC2 instance
uses: easingthemes/[email protected]
with:
REMOTE_HOST: 'ec2-13-41-72-100.eu-west-2.compute.amazonaws.com'
Expand Down
6 changes: 2 additions & 4 deletions go/rpc/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rpc
import (
"context"
"net/http"
"os"

"connectrpc.com/connect"
connectcors "connectrpc.com/cors"
Expand Down Expand Up @@ -104,10 +105,7 @@ func registerHandlers(lc fx.Lifecycle, handlers []Handler, options []connect.Han

func withCORS(h http.Handler) http.Handler {
middleware := cors.New(cors.Options{
AllowedOrigins: []string{
"https://localhost:5173",
"http://vue-js-app.s3-website.eu-west-2.amazonaws.com",
},
AllowedOrigins: []string{os.Getenv("CORS_ALLOWED_ORIGIN")},
AllowedMethods: []string{
http.MethodGet,
http.MethodPost,
Expand Down

0 comments on commit f4e9c62

Please sign in to comment.