-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.62 KB
/
deploy-master.yaml
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
name: Deploy-Master
on:
push:
branches:
- master
paths:
- envs/**
- chart/**
- .github/workflows/deploy-*.yaml
env:
OPENSHIFT_API: https://api.cloudscale-lpg-2.appuio.cloud:6443
HELM_RELEASE_NAME: odootools
NAMESPACE: vshn-odoo-prod
jobs:
upgrade:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Setup helmfile
uses: mamezou-tech/[email protected]
with:
helm-version: v3.7.1
helmfile-version: v0.142.0
install-kubectl: false
- name: Install CLI tools from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4"
- name: Authenticate and set context
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_API }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
namespace: ${{ env.NAMESPACE }}
# We don't have a LE cert yet
insecure_skip_tls_verify: true
# Note: The following steps will fail if there's no deployment.
# On default branch, we don't know what the last pushed image tag was, so let's retrieve from currently deployed release.
- name: Gather status
run: |
echo "IMG_TAG=$(helm -n ${{ env.NAMESPACE }} get values ${{ env.HELM_RELEASE_NAME }} | yq eval '.image.tag' -)" >> $GITHUB_ENV
- name: Deploy app
run: helmfile -f envs/helmfile.yaml -e prod apply
env:
HELM_RELEASE_NAME: ${{ env.HELM_RELEASE_NAME }}
IMG_TAG: ${{ env.IMG_TAG }}
ODOO_DB: ${{ secrets.ODOO_DB }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}