Skip to content

Commit

Permalink
intento 3 de arreglar despliegue
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Mar 11, 2024
1 parent b6714a0 commit 351b65e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: 8000
REACT_APP_API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
with:
name: arquisoft/wiq_es04c/webapp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: webapp
buildargs: DEPLOY_HOST,DEPLOY_PORT
buildargs: REACT_APP_API_URI
docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand Down
9 changes: 5 additions & 4 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ WORKDIR /app
#Install the dependencies
RUN npm install

#tomar los valores de las variables de entorno del buildargs
ARG DEPLOY_HOST
ARG DEPLOY_PORT
# Take the values of the environment variables from the buildargs
ARG REACT_APP_API_URI

# Set the environment variable
ENV REACT_APP_API_URI=$REACT_APP_API_URI

ENV API_URI=http://${DEPLOY_HOST}:${DEPLOY_PORT}

#Create an optimized version of the webapp
RUN npm run build
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/adduser/AddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.API_URI || 'http://localhost:8000';
const apiEndpoint = process.env.REACT_APP_API_URI ||'http://localhost:8000';

const AddUser = () => {
const [username, setUsername] = useState('');
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Login = () => {
const [createdAt, setCreatedAt] = useState('');
const [openSnackbar, setOpenSnackbar] = useState(false);

const apiEndpoint = process.env.API_URI ||'http://localhost:8000';
const apiEndpoint = process.env.REACT_APP_API_URI ||'http://localhost:8000';

useEffect(() => {
if (loginSuccess) {
Expand Down

0 comments on commit 351b65e

Please sign in to comment.