Skip to content

Commit

Permalink
release try
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiollende committed Mar 20, 2024
1 parent b2f3e49 commit 6157f00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@ jobs:
packages: write
steps:
- uses: actions/checkout@v4
- name: Create .env file
run: echo "REACT_APP_API_ENDPOINT=http://${{ secrets.DEPLOY_HOST }}:8080" > webapp/.env
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
REACT_APP_API_ENDPOINT: http://${{ secrets.DEPLOY_HOST }}:8000
API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
with:
name: arquisoft/wiq_en3a/webapp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: webapp
buildargs: |
REACT_APP_API_ENDPOINT
docker-push-wikidata-service:
buildargs: API_URI
docker-push-wikidataservice:
name: Push wikidata Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -79,7 +76,7 @@ jobs:
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-gatewayservice,docker-push-webapp, docker-push-wikidata-service]
needs: [docker-push-userservice,docker-push-gatewayservice,docker-push-webapp, docker-push-wikidataservice]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
7 changes: 1 addition & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,7 @@ services:
container_name: webapp-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_en3a/webapp:latest
profiles: ["dev", "prod"]
build:
args:
REACT_APP_API_ENDPOINT: ${API_URI}
context: ./webapp
environment:
- REACT_APP_API_ENDPOINT=${API_URI}
build: ./webapp
depends_on:
- gatewayservice
ports:
Expand Down
6 changes: 3 additions & 3 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app.get('/health', (_req, res) => {
res.json({ status: 'OK' });
});

app.post('/login', async (req, res) => {
app.post(userServiceUrl + '/login', async (req, res) => {
try {
// Forward the login request to the authentication service
const authResponse = await axios.post(userServiceUrl + '/auth/login', req.body);
Expand All @@ -31,7 +31,7 @@ app.post('/login', async (req, res) => {
}
});

app.post('/adduser', async (req, res) => {
app.post(userServiceUrl + '/adduser', async (req, res) => {
try {
// Forward the add user request to the user service
const userResponse = await axios.post(userServiceUrl + '/user/adduser', req.body);
Expand All @@ -51,7 +51,7 @@ app.post('/edituser', async (req, res) => {
}
});

app.get('/WikiData/GetCapitalsQuestions', async (_req, res) => {
app.get(wikidataServiceUrl + '/WikiData/GetCapitalsQuestions', async (_req, res) => {
try {
// Forward the edit user request to the user service
const wikiResponse = await axios.get(wikidataServiceUrl+'/WikiData/GetCapitalsQuestions');
Expand Down

0 comments on commit 6157f00

Please sign in to comment.