diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30449c49..d3717953 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,14 +51,14 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - API_URI: http://${{ secrets.DEPLOY_HOST }}:8000 + REACT_APP_API_URI: http://${{ secrets.DEPLOY_HOST }}:8000 with: name: arquisoft/wiq_es05c/webapp username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: webapp - buildargs: API_URI + buildargs: REACT_APP_API_URI docker-push-authservice: name: Push auth service Docker Image to GitHub Packages runs-on: ubuntu-latest diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 3cbad8b7..03981897 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -6,8 +6,8 @@ WORKDIR /app #Install the dependencies RUN npm install -ARG API_URI="http://localhost:8000" -ENV REACT_APP_API_ENDPOINT=$API_URI +ARG REACT_APP_API_URI +ENV REACT_APP_API_URI=$REACT_APP_API_URI #Create an optimized version of the webapp RUN npm run build diff --git a/webapp/src/components/AddUser.js b/webapp/src/components/AddUser.js index 00d522a2..ee095e8d 100644 --- a/webapp/src/components/AddUser.js +++ b/webapp/src/components/AddUser.js @@ -3,7 +3,7 @@ import React, { useState } from 'react'; import axios from 'axios'; import { Container, Typography, TextField, Button, Snackbar } from '@mui/material'; -const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; +const apiEndpoint = process.env.REACT_APP_API_URI || 'http://localhost:8000'; const AddUser = () => { const [username, setUsername] = useState(''); diff --git a/webapp/src/components/Login.js b/webapp/src/components/Login.js index 0ad6268e..e1cdc1cd 100644 --- a/webapp/src/components/Login.js +++ b/webapp/src/components/Login.js @@ -11,7 +11,7 @@ const Login = () => { const [createdAt, setCreatedAt] = useState(''); const [openSnackbar, setOpenSnackbar] = useState(false); - const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; + const apiEndpoint = process.env.REACT_APP_API_URI || 'http://localhost:8000'; const loginUser = async () => { try {