-
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.54 KB
/
backend.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
name: Build & Deploy Backend
on: workflow_dispatch
env:
PROJECT_NAME: subabot
jobs:
build_and_push:
name: Build & Push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build, tag and push Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
push: true
tags: ${{ github.repository_owner }}/${{ env.PROJECT_NAME }}:${{ github.sha }}
platforms: linux/arm64
deploy_to_production:
name: Deploy to production
needs: build_and_push
runs-on: ubuntu-latest
environment: production
concurrency:
group: production
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Helm Configure & Deploy
uses: dorukgezici/helm-deploy-action@v1
with:
kubeconfig-base64: ${{ secrets.KUBE_CONFIG }}
installation-name: ${{ env.PROJECT_NAME }}
chart-path: backend/k8s-helm
extra-args: "--set image.tag=${{ github.sha }}"
token: ${{ github.token }}