From b6714a0f4773faf5aa2a16057be0b24afb6c02e5 Mon Sep 17 00:00:00 2001 From: bidof Date: Mon, 11 Mar 2024 19:35:54 +0100 Subject: [PATCH] arreglar despliegue --- .github/workflows/release.yml | 5 +++-- webapp/Dockerfile | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26fee8b..c0a9866 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,14 +51,15 @@ jobs: - name: Publish to Registry uses: elgohr/Publish-Docker-Github-Action@v5 env: - API_URI: http://${{ secrets.DEPLOY_HOST }}:8000 + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_PORT: 8000 with: name: arquisoft/wiq_es04c/webapp username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} registry: ghcr.io workdir: webapp - buildargs: API_URI + buildargs: DEPLOY_HOST,DEPLOY_PORT docker-push-questionservice: name: Push question service Docker Image to GitHub Packages runs-on: ubuntu-latest diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 0ea8d89..5da6151 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -6,11 +6,11 @@ WORKDIR /app #Install the dependencies RUN npm install -# Take API_URI as a build argument -ARG API_URI +#tomar los valores de las variables de entorno del buildargs +ARG DEPLOY_HOST +ARG DEPLOY_PORT -# Set API_URI as an environment variable -ENV API_URI=$API_URI +ENV API_URI=http://${DEPLOY_HOST}:${DEPLOY_PORT} #Create an optimized version of the webapp RUN npm run build