forked from idcf-boat-house/boat-house-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (61 loc) · 3.4 KB
/
statistics-service.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build and Deploy dev statistics-service
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: list env
run: env
- name: docker build statistics-service/api
run: docker build -f statistics-service/api/Dockerfile -t docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_api:${GITHUB_REF##*/}-ci-${GITHUB_RUN_NUMBER} -t docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_api:ci statistics-service/api
- name: docker build statistics-service/worker
run: docker build -f statistics-service/worker/Dockerfile -t docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_worker:${GITHUB_REF##*/}-ci-${GITHUB_RUN_NUMBER} -t docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_worker:ci statistics-service/worker
- name: docker images
run: docker images
- name: docker login
run : docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY%/*} -p ${{ secrets.packages_token }}
- name: docker push statistics_service_api tag branch number
run : docker push docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_api:${GITHUB_REF##*/}-ci-${GITHUB_RUN_NUMBER}
- name: docker push statistics_service_api tag latest
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_api:ci
- name: docker push statistics_service_worker tag branch number
run : docker push docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_worker:${GITHUB_REF##*/}-ci-${GITHUB_RUN_NUMBER}
- name: docker push statistics_service_worker tag latest
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY}/statistics_service_worker:ci
deploy-dev:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: list env
run: env && ls
- name: replace project name
run: sed -i "s|docker.pkg.github.com\/idcf-boat-house\/boat-house|docker.pkg.github.com\/${GITHUB_REPOSITORY%/*}\/boat-house|g" kompose/test/statistics-service-*.yaml
- name: replace docker images tags
run: sed -i "s|:latest$|:ci|g" kompose/test/statistics-service-*.yaml
- name: grep images url
run: grep -i "image:" kompose/test/statistics-service-*.yaml
#run: ls kompose/test/statistics-service-*.yaml
- uses: Azure/k8s-set-context@v1
with:
kubeconfig: ${{ secrets.KUBE_CONFIG }}
- uses: Azure/k8s-create-secret@v1
with:
container-registry-url: docker.pkg.github.com
container-registry-username: ${GITHUB_REPOSITORY%/*}
container-registry-password: ${{ secrets.packages_token }}
secret-name: demo-k8s-secret
- uses: Azure/k8s-deploy@v1
with:
namespace: 'boathouse-test-github'
manifests: |
kompose/test/statistics-service-api-deployment.yaml
kompose/test/statistics-service-api-svc.yaml
kompose/test/statistics-service-db-deployment.yaml
kompose/test/statistics-service-db-svc.yaml
kompose/test/statistics-service-redis-deployment.yaml
kompose/test/statistics-service-redis-svc.yaml
kompose/test/statistics-service-worker-deployment.yaml
kompose/test/statistics-service-worker-svc.yaml
kubectl-version: 'latest'