-
Notifications
You must be signed in to change notification settings - Fork 6
72 lines (70 loc) · 2.4 KB
/
deploy-prod.yml
File metadata and controls
72 lines (70 loc) · 2.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Build and Deploy
on:
push:
branches: [main]
jobs:
build:
permissions: write-all
name: Build and Deploy
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata from repository
uses: docker/metadata-action@v3
id: meta
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push to ghcr.io
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
'DEPLOY_URL=polyglot-edu.com'
'BACK_URL=https://polyglot-api.polyglot-edu.com'
'TEST_MODE=true'
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Push to ghcr.io with retries
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: echo "${{ steps.meta.outputs.tags }}" | while IFS= read -r i; do echo "Pushing $i"; docker push $i; done
- name: Deploy to Kubernetes cluster
uses: daviFrag/helm@master
with:
release: 'node-editor-prod'
namespace: 'node-editor-prod'
chart: 'charts'
token: '${{ github.token }}'
values: |
url: polyglot-edu.com
cfOriginKey: ${{ secrets.CFORIGIN }}
dockerconfigjson: ${{ secrets.DOCKER_CONFIG }}
image:
repository: ${{ steps.meta.outputs.tags }}
env:
authSecret: ${{ secrets.AUTH0_SECRET }}
authIssuerUrl: ${{ secrets.AUTH0_ISSUER_BASE_URL }}
authClientId: ${{ secrets.AUTH0_CLIENT_ID }}
authClientSecret: ${{ secrets.AUTH0_CLIENT_SECRET }}
authAudience: ${{ secrets.AUTH0_AUDIENCE }}
authScope: ${{ secrets.AUTH0_SCOPE }}
backUrl: https://polyglot-api.polyglot-edu.com
testMode: true
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'