-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (91 loc) · 3.16 KB
/
ide-ci.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Anubis IDE CD/CI
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
# Build Stage.
# Will build the docker image, and push it
# to the container registry.
# Build IDE base images
build-ide-base-images:
name: Build IDE base images
runs-on: ubuntu-latest
environment: anubis
strategy:
matrix:
base-image:
- theia-base-38
- theia-base-39
- theia-base-310
- webtop-base-38
- webtop-base-39
- webtop-base-310
steps:
- uses: actions/checkout@v2
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log into DigitalOcean container registry
run: doctl registry login
- name: Build base IDE images
run: env GIT_TAG=$(git log -1 --pretty=%h) docker compose build ${{ matrix.base-image }}
- name: Build base IDE images
run: env GIT_TAG=latest docker compose build ${{ matrix.base-image }}
- name: Push base IDE images to registry
run: env GIT_TAG=$(git log -1 --pretty=%h) docker compose push ${{ matrix.base-image }}
- name: Push base IDE images to registry
run: env GIT_TAG=latest docker compose push ${{ matrix.base-image }}
# Build IDE downstream images
build-ide-downstream-images:
name: Build IDE downstream images
runs-on: ubuntu-latest
environment: anubis
strategy:
matrix:
downstream-image:
- theia-cpp
- theia-admin
- theia-golang
- theia-flask-39
- theia-flask-310
- theia-mysql-39
- theia-mysql-310
- theia-devops
- theia-jepst
- webtop-jepst
steps:
- uses: actions/checkout@v2
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log into DigitalOcean container registry
run: doctl registry login
- name: Build downstream IDE images
run: env GIT_TAG=$(git log -1 --pretty=%h) docker compose build ${{ matrix.downstream-image }}
- name: Build downstream IDE images
run: env GIT_TAG=latest docker compose build ${{ matrix.downstream-image }}
- name: Push downstream IDE images to registry
run: env GIT_TAG=$(git log -1 --pretty=%h) docker compose push ${{ matrix.downstream-image }}
- name: Push downstream IDE images to registry
run: env GIT_TAG=latest docker compose push ${{ matrix.downstream-image }}
# Deploy step.
# Will push out yaml to the k8s cluster, then restart
# deployments.
deploy:
name: Deploy to Anubis k8s cluster
needs: [build-ide-base-images, build-ide-downstream-images]
runs-on: ubuntu-latest
environment: anubis
steps:
- uses: actions/checkout@v2
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save anubis
- name: Propagate latest IDE images
run: make prop-ides