Skip to content

Commit

Permalink
Merge pull request #100 from Arquisoft/fix/actions
Browse files Browse the repository at this point in the history
Fixed actions
  • Loading branch information
Toto-hitori authored Mar 9, 2024
2 parents c999049 + c90c2c6 commit 6e0d78e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]
push:
branches:
- master
- fix/actions

jobs:
docker-push-api:
Expand All @@ -15,7 +15,6 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
API_URI: http://${{ secrets.DEPLOY_HOST }}:8080
DATABASE_USER: ${{ secrets.DATABASE_USER }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
Expand All @@ -36,7 +35,7 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
API_URI: ${{ secrets.DEPLOY_HOST }}
API_URI: http://${{ secrets.DEPLOY_HOST }}:8080
teamname: wiq_en2b
with:
name: arquisoft/wiq_en2b/webapp
Expand All @@ -62,15 +61,11 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
git clone https://github.com/Arquisoft/wiq_en2b.git
git pull
cd wiq_en2b
wget https://raw.githubusercontent.com/arquisoft/wiq_en2b/fix/actions/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_en2b/master/.env -O .env
echo "DATABASE_USER=${{ secrets.DATABASE_USER }}" >> .env
echo "DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }}" >> .env
echo "JWT_SECRET=${{ secrets.JWT_SECRET }}" >> .env
echo "API_URI=http://${{ secrets.DEPLOY_HOST }}:8080" >> .env
sudo docker compose down
sudo docker compose pull
sudo docker compose --profile prod up -d
cd ../
rm -r wiq_en2b --force
docker compose down
docker compose --profile prod up -d
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ services:
container_name: webapp-${teamname:-defaultASW}
image: webapp:latest
profiles: [ "dev", "prod" ]

build:
context: ./webapp
args:
API_URI: http://${API_URI}:8080
environment:
- REACT_APP_API_ENDPOINT=${API_URI}
ports:
- "3000:3000"

Expand Down
3 changes: 0 additions & 3 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ WORKDIR /app
#Install the dependencies
RUN npm install

ARG API_URI
ENV REACT_APP_API_ENDPOINT $API_URI

#Create an optimized version of the webapp
RUN npm run build
RUN npm install serve
Expand Down

0 comments on commit 6e0d78e

Please sign in to comment.