-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (57 loc) · 1.8 KB
/
deploy-dev-branch-qa.yaml
File metadata and controls
68 lines (57 loc) · 1.8 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build and deploy dev
on:
push:
branches:
- dev
- develop
jobs:
build_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install docker-stack
run: pip install --upgrade docker-stack
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
## build step can use any of the yaml file it doesn't matter
run: docker-stack build --push docker-compose-qa.yml
env:
IMAGE_VERSION_TAG: ${{ github.sha }}
deploy_services:
name: Dev Deploy
needs: build_image
runs-on: nepal
environment: dev_qa
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install docker-stack
run: pip install --upgrade docker-stack
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy stack
run: docker-stack deploy --with-registry-auth mail_service_qa docker-compose-qa.yml
env:
COMMIT_SHA: ${{ github.sha }}
IMAGE_VERSION_TAG: ${{ github.sha }}
POSTGRES_USER: ${{ vars.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ vars.POSTGRES_DB }}