-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.87 KB
/
main.yaml
File metadata and controls
56 lines (54 loc) · 1.87 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
name: CI/CD
on:
push:
branches:
- master
jobs:
lint-and-build:
name: Run eslint and build
runs-on: ubuntu-latest
container:
image: node
steps:
- uses: actions/checkout@v2
- name: Install dependencies
uses: pnpm/action-setup@v2.0.1
with:
version: 7.0.0-rc.7
run_install: true
- name: Lint
uses: borales/actions-yarn@v2.1.0
with:
cmd: lint
- name: Build
uses: borales/actions-yarn@v2.1.0
with:
cmd: build
build:
name: Build docker container
runs-on: ubuntu-latest
needs: lint-and-build
steps:
- uses: actions/checkout@v2
- name: Login to github docker
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.PACKAGES_TOKEN }}
- name: Build docker image
run: docker build -t ${{ github.event.repository.name }} .
- name: Docker tag
run: docker tag ${{ github.event.repository.name }} ghcr.io/matchmakerbot/${{ github.event.repository.name }}:latest
- name: Push docker image
run: docker push ghcr.io/matchmakerbot/${{ github.event.repository.name }}:latest
deploy:
name: Deploy to kubernetes
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Create Kube Config File
run: echo $KUBE_CONFIG | base64 --decode > $GITHUB_WORKSPACE/.kubeconfig
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
- name: Install helm
run: curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh
- name: Update deployment
run: helm upgrade ${{ github.event.repository.name }} ./chart --install --atomic --namespace matchmaker --timeout 2m --kubeconfig=$GITHUB_WORKSPACE/.kubeconfig --set-string sha=${{ github.sha }}