Skip to content

Commit

Permalink
Despligue en Azure
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmanuelanton committed Apr 26, 2022
1 parent bf658b6 commit a01a08e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/asw2122.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,20 @@ jobs:
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
registry: ghcr.io
workdir: restapi
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-restapi,docker-push-webapp]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
with:
host: ${{ secrets.DEPLOY_HOST }}
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
wget https://raw.githubusercontent.com/pglez82/asw2122_0/master/docker-compose-deploy.yml -O docker-compose.yml
docker-compose stop
docker-compose rm -f
docker-compose pull
docker-compose up -d
12 changes: 12 additions & 0 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.5'
services:
restapi:
image: ghcr.io/pglez82/asw2122_0/restapi:latest
ports:
- "5000:5000"
webapp:
image: ghcr.io/pglez82/asw2122_0/webapp:latest
ports:
- "3000:3000"
depends_on:
- restapi
4 changes: 4 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ WORKDIR /app
#Install the dependencies
RUN npm install

# Variables for deploy in Azure
ARG API_URI="http://localhost:5000/api"
ENV REACT_APP_API_URI=$API_URI

#Create an optimized version of the webapp
RUN npm run build

Expand Down

0 comments on commit a01a08e

Please sign in to comment.