Updated setup.exe (#213) #164
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Delivery | |
on: | |
push: | |
branches: [ development ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build_core_service: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push Core Service | |
uses: docker/build-push-action@v4 | |
with: | |
tags: alinasielina/squirrel_core:latest | |
context: ./backend | |
file: ./backend/Squirrel.Core/Dockerfile | |
build-args: PROJECT_PORT=5050 | |
push: true | |
build_sql_service: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push Sql Service | |
uses: docker/build-push-action@v4 | |
with: | |
tags: alinasielina/squirrel_sql:latest | |
context: ./backend | |
file: ./backend/Squirrel.SqlService/Dockerfile | |
build-args: PROJECT_PORT=5076 | |
push: true | |
build_notifier_service: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push Notifier Service | |
uses: docker/build-push-action@v4 | |
with: | |
tags: alinasielina/squirrel_notifier:latest | |
context: ./backend | |
file: ./backend/Squirrel.Notifier/Dockerfile | |
build-args: PROJECT_PORT=5070 | |
push: true | |
build_frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build Frontend | |
uses: docker/build-push-action@v4 | |
with: | |
tags: alinasielina/squirrel_frontend:latest | |
context: ./frontend | |
push: true | |
deploy_images: | |
runs-on: ubuntu-latest | |
needs: [ build_core_service, build_notifier_service, build_frontend ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update PROD images | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{secrets.SSH_HOST}} | |
username: ${{secrets.SSH_USERNAME}} | |
key: ${{secrets.SSH_KEY}} | |
script: cd ~/squirrel && sudo docker-compose -f docker-compose.apps.prod.yml stop && sudo docker-compose -f docker-compose.apps.prod.yml pull && sudo docker system prune -f && sudo docker-compose -f docker-compose.apps.prod.yml up -d |