Skip to content

Commit

Permalink
Merge branch 'master' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
bidof committed Mar 5, 2024
2 parents bd86227 + 5a07bde commit 1a4354d
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 52 deletions.
56 changes: 30 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Deploy on release

on:
release:
types: [published]
push:
branches:
-master
-releases

jobs:
unit-tests:
Expand Down Expand Up @@ -39,24 +41,7 @@ jobs:
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e

docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice


docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
Expand All @@ -70,7 +55,9 @@ jobs:
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
API_URI: http://${{ secrets.DEPLOY_HOST || 'localhost' }}:8000


with:
name: arquisoft/wiq_es04c/webapp
username: ${{ github.actor }}
Expand Down Expand Up @@ -129,7 +116,26 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice
workdir: ./gatewayservice

docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2e-tests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es04c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: ./questionservice

deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
Expand All @@ -142,10 +148,8 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
pwd
ls -la
cd wiq_es04c
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es04c/releases/.env -O .env
docker compose down
git clone -b releases https://github.com/Arquisoft/wiq_es04c.git
docker compose --profile prod down
docker compose --profile prod up -d
26 changes: 12 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mongodb:
container_name: mongodb-${teamname:-defaultASW}
container_name: mongodb-${teamname:-wiq_0}
image: mongo
profiles: ["dev", "prod"]
volumes:
Expand All @@ -12,8 +12,8 @@ services:
- mynetwork

authservice:
container_name: authservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es04c/authservice:latest
container_name: authservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/authservice:latest
profiles: ["dev", "prod"]
build: ./users/authservice
depends_on:
Expand All @@ -26,8 +26,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

userservice:
container_name: userservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es04c/userservice:latest
container_name: userservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/userservice:latest
profiles: ["dev", "prod"]
build: ./users/userservice
depends_on:
Expand All @@ -40,8 +40,8 @@ services:
MONGODB_URI: mongodb://mongodb:27017/userdb

gatewayservice:
container_name: gatewayservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es04c/gatewayservice:latest
container_name: gatewayservice-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/gatewayservice:latest
profiles: ["dev", "prod"]
build: ./gatewayservice
depends_on:
Expand All @@ -58,18 +58,16 @@ services:
USER_SERVICE_URL: http://userservice:8001

questionservice:
container_name: questionservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es04c/questionservice:latest

container_name: questionservice-${teamname:-wiq_0}
build: ./questionservice
ports:
- "8003:8003"
networks:
- mynetwork

webapp:
container_name: webapp-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_es04c/webapp:latest
container_name: webapp-${teamname:-wiq_0}
image: ghcr.io/arquisoft/${teamname:-wiq_0}/webapp:latest
profiles: ["dev", "prod"]
build: ./webapp
depends_on:
Expand All @@ -81,7 +79,7 @@ services:

prometheus:
image: prom/prometheus
container_name: prometheus-${teamname:-defaultASW}
container_name: prometheus-${teamname:-wiq_0}
profiles: ["dev"]
networks:
- mynetwork
Expand All @@ -95,7 +93,7 @@ services:

grafana:
image: grafana/grafana
container_name: grafana-${teamname:-defaultASW}
container_name: grafana-${teamname:-wiq_0}
profiles: ["dev"]
networks:
- mynetwork
Expand Down
6 changes: 3 additions & 3 deletions gatewayservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/arquisoft/wiq_0.git"
"url": "git+https://github.com/arquisoft/wiq_es04c.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/arquisoft/wiq_0/issues"
"url": "https://github.com/arquisoft/wiq_es04c/issues"
},
"homepage": "https://github.com/arquisoft/wiq_0#readme",
"homepage": "https://github.com/arquisoft/wiq_es04c#readme",
"dependencies": {
"axios": "^1.6.5",
"cors": "^2.8.5",
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions questionservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/arquisoft/wiq_0.git"
"url": "git+https://github.com/arquisoft/wiq_es04c.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/arquisoft/wiq_0/issues"
"url": "https://github.com/arquisoft/wiq_es04c/issues"
},
"homepage": "https://github.com/arquisoft/wiq_0#readme",
"homepage": "https://github.com/arquisoft/wiq_es04c#readme",
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
Expand Down
6 changes: 3 additions & 3 deletions users/authservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/arquisoft/wiq_0.git"
"url": "git+https://github.com/arquisoft/wiq_es04c.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/arquisoft/wiq_0/issues"
"url": "https://github.com/arquisoft/wiq_es04c/issues"
},
"homepage": "https://github.com/arquisoft/wiq_0#readme",
"homepage": "https://github.com/arquisoft/wiq_es04c#readme",
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
Expand Down
6 changes: 3 additions & 3 deletions users/userservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/arquisoft/wiq_0.git"
"url": "git+https://github.com/arquisoft/wiq_es04c.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/arquisoft/wiq_0/issues"
"url": "https://github.com/arquisoft/wiq_es04c/issues"
},
"homepage": "https://github.com/arquisoft/wiq_0#readme",
"homepage": "https://github.com/arquisoft/wiq_es04c#readme",
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
Expand Down

0 comments on commit 1a4354d

Please sign in to comment.