Skip to content

CD

CD #21

name: CD
on:
workflow_dispatch:
release:
types: [published]
jobs:
base_image_build:
name: Base image build
uses: ./.github/workflows/base-image-build.yml
if: ${{ github.event_name != 'push' || github.event.pull_request.head.sha != github.sha }}
secrets: inherit
final_image_build:
name: UpdateService image build
uses: ./.github/workflows/final-image-build.yml
needs: [base_image_build]
if: ${{ github.event_name != 'push' || github.event.pull_request.head.sha != github.sha }}
secrets: inherit
unit_tests:
name: Unit Tests
uses: ./.github/workflows/unit-tests.yml
needs: [base_image_build]
if: ${{ github.event_name != 'push' || github.event.pull_request.head.sha != github.sha }}
secrets: inherit
integration_tests:
name: Integration Tests
uses: ./.github/workflows/integration-tests.yml
needs: [base_image_build]
if: ${{ github.event_name != 'push' || github.event.pull_request.head.sha != github.sha }}
secrets: inherit
deploy_production:
name: Deploy production
needs: [base_image_build, final_image_build, unit_tests, integration_tests]
environment: 'production'
runs-on: ubuntu-latest
steps:
- name: Updating the image on the server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DOCKER_HOST }}
username: ${{ secrets.GITHUBWORKFLOWS_USER }}
password: ${{ secrets.GITHUBWORKFLOWS_USER_PASSWORD }}
port: ${{ secrets.DOCKER_HOST_PORT }}
script: |
cd scripts/UpdateService
./update_production.sh ${{ github.sha }}