Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed actions #100

Merged
merged 5 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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