Skip to content

refactor: updated nginx configuration #15

refactor: updated nginx configuration

refactor: updated nginx configuration #15

Workflow file for this run

name: CI/CD Deploy Pipeline # The name of the workflow
on:
pull_request:
types:
- closed
workflow_dispatch:
jobs:
deploy:
name: "Publish Application"
runs-on: ubuntu-latest
steps:
- name: "Run deploy on SSH"
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'deployment'
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd app
echo ${{ secrets.REGISTRY_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'backend') }}" == "true" ]]; then
docker rm $(docker stop $(docker ps -a -q --filter ancestor=ghcr.io/dmytro-komlyk/prod-fixlab-server:latest ))
docker rmi ghcr.io/dmytro-komlyk/prod-fixlab-server:latest
fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'frontend-client') }}" == "true" ]]; then
docker rm $(docker stop $(docker ps -a -q --filter ancestor=ghcr.io/dmytro-komlyk/prod-fixlab-client:latest ))
docker rmi ghcr.io/dmytro-komlyk/prod-fixlab-client:latest
fi
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'frontend-admin') }}" == "true" ]]; then
docker rm $(docker stop $(docker ps -a -q --filter ancestor=ghcr.io/dmytro-komlyk/prod-fixlab-admin:latest ))
docker rmi ghcr.io/dmytro-komlyk/prod-fixlab-admin:latest
fi
docker compose -f docker-compose.prod-ci.yml -p fix-lab-prod pull
docker compose -f docker-compose.prod-ci.yml -p fix-lab-prod up -d