-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (82 loc) · 3.23 KB
/
deploy-pr.yml
File metadata and controls
85 lines (82 loc) · 3.23 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
73
74
75
76
77
78
79
80
81
82
83
84
name: Build and Deploy
on:
pull_request:
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=https://${{ steps.meta.outputs.version }}.polyglot-edu.com"
"BACK_URL=https://polyglot-api-staging.polyglot-edu.com"
"TEST_MODE=true"
"AUTH0_SECRET=${{ secrets.AUTH0_SECRET }}"
"AUTH0_ISSUER_BASE_URL=${{ secrets.AUTH0_ISSUER_BASE_URL }}"
"AUTH0_CLIENT_ID=${{ secrets.AUTH0_CLIENT_ID }}"
"AUTH0_CLIENT_SECRET=${{ secrets.AUTH0_CLIENT_SECRET }}"
"AUTH0_AUDIENCE=${{ secrets.AUTH0_AUDIENCE }}"
"AUTH0_SCOPE=${{ secrets.AUTH0_SCOPE }}"
"APIKEY=${{ secrets.APIKEY }}"
"SETUPMODEL=${{ secrets.SETUPMODEL }}"
"AIGENERATION_URL=https://skapi.polyglot-edu.com"
no-cache: 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-${{ steps.meta.outputs.version }}
namespace: node-editor-${{ steps.meta.outputs.version }}
chart: 'charts'
token: '${{ github.token }}'
values: |
url: ${{ steps.meta.outputs.version }}.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 }}
apiKey: ${{ secrets.APIKEY }}
setupModel: ${{ secrets.SETUPMODEL }}
aiGenerationUrl: https://skapi.polyglot-edu.com
backUrl: https://polyglot-api-staging.polyglot-edu.com
testMode: false
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'