-
Notifications
You must be signed in to change notification settings - Fork 9
41 lines (34 loc) · 1.28 KB
/
development-workflow.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
name: Development workflow
on:
push:
branches: [ develop ]
jobs:
setup:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Set Up ENV
run: |
echo "${{ secrets.API_TOKEN }}" >> ./api/.env
echo "${{ secrets.API_ENDPOINT }}" >> ./api/.env
echo "${{ secrets.SECRET_TOKEN}}" >> ./api/.env
build-image:
needs: setup
runs-on: self-hosted
steps:
- name: Build the Docker image
run: docker build . --file Dockerfile -t bot-detector/bd-ml:latest --build-arg api_port=6532 --build-arg root_path=/ml --target production
- name: Tag Image
run: docker tag bot-detector/bd-ml:latest hub.osrsbotdetector.com/bot-detector/bd-ml:latest
- name: Login to Docker Registry
run: echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login https://hub.osrsbotdetector.com -u "${{ secrets.DOCKER_REGISTRY_USERNAME }}" --password-stdin
- name: Push Image to Registry
run: docker push hub.osrsbotdetector.com/bot-detector/bd-ml:latest
deploy:
needs: build-image
runs-on: self-hosted
steps:
- name: Apply Possible Deployment Changes
run: kubectl apply -f deployment/
- name: Restart Deployment for Possible Container Changes
run: kubectl rollout restart deploy bd-ml