-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.6 KB
/
continuous-delivery.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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 }}