Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/_deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ jobs:
with:
fetch-depth: 0

- name: Checkout werf repo
uses: actions/checkout@v6
with:
repository: werf/werf
path: werf
fetch-depth: 0

- name: Inject trdl_channels.yaml
run: |
cp werf/trdl_channels.yaml .helm/trdl_channels.yaml

- name: Install werf
uses: werf/actions/install@v2

Expand Down Expand Up @@ -86,7 +75,6 @@ jobs:
env:
WERF_REPO: ghcr.io/${{ github.repository_owner }}/werfio-guides
WERF_STAGES_STORAGE: ghcr.io/werf/werfio-guides-stages
WERF_SET_ACTIVE_RELEASE: global.active_release=2
WERFIO_GITHUB_TOKEN: ${{ secrets.API_TOKEN }}
WERF_NAMESPACE: "werfio-production"
WERF_RELEASE: "werfio-site-production"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
tags:
- "v2*"
- "v1.2*"
workflow_dispatch:
inputs:
targetCluster:
Expand Down
28 changes: 1 addition & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,21 @@ on:
workflow_dispatch:

env:
WERF_ENV: "production"
WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio-guides"
WERF_STAGES_STORAGE: "ghcr.io/werf/werfio-guides-stages"
WERF_SET_ACTIVE_RELEASE: "global.active_release=2"
WERFIO_GITHUB_TOKEN: "${{ secrets.API_TOKEN }}"

jobs:
converge:
name: Deploy
if: contains(github.event.pull_request.labels.*.name, 'test website') || contains(github.event.pull_request.labels.*.name, 'stage website')
if: contains(github.event.pull_request.labels.*.name, 'test website')
runs-on: prod-github-runner-0
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Checkout werf repo
uses: actions/checkout@v6
with:
repository: werf/werf
path: werf
fetch-depth: 0

- name: Inject trdl_channels.yaml
run: |
cp werf/trdl_channels.yaml .helm/trdl_channels.yaml

- name: Install werf
uses: werf/actions/install@v2

Expand All @@ -50,19 +37,6 @@ jobs:
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy to stage
if: contains(github.event.pull_request.labels.*.name, 'stage website')
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_NAMESPACE: "werfio-stage"
WERF_RELEASE: "werfio-site-stage"
WERF_LOG_VERBOSE: "on"
WERF_ENV: "stage"
WERF_KUBE_CONFIG_BASE64: ${{ secrets.KUBECONFIG_BASE64_DEV }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notification:
name: Notification
if: always()
Expand Down
27 changes: 6 additions & 21 deletions .helm/templates/12-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ spec:
name: http
protocol: TCP
env:
- name: ACTIVE_RELEASE
value: {{ .Values.global.active_release | quote }}
- name: CURRENT_DOCS_MAJOR
value: {{ .Values.docs.currentRoot | quote }}
- name: SUPPORTED_DOCS_MAJOR_VERSIONS
value: {{ join "," .Values.docs.supportedRoots | quote }}
- name: DOCS_LATEST_ALIAS_ENABLED
value: {{ .Values.docs.latestAliasEnabled | quote }}
- name: LOG_LEVEL
value: "info"
{{- if ne .Values.werf.env "production" }}
Expand All @@ -53,13 +57,6 @@ spec:
httpGet:
path: /health
port: 8080
volumeMounts:
- name: trdl-data
mountPath: /app/trdl
volumes:
- name: trdl-data
configMap:
name: trdl-data
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -96,15 +93,3 @@ spec:
selector:
matchLabels:
service: backend
---
apiVersion: v1
kind: ConfigMap
metadata:
name: trdl-data
data:
trdl_channels.yaml: |
{{- if eq .Values.werf.env "production" }}
{{ .Files.Get "trdl_channels.yaml" | indent 4 }}
{{- else }}
{{ .Files.Get "trdl_channels-dev.yaml" | indent 4 }}
{{- end }}
8 changes: 2 additions & 6 deletions .helm/templates/20-ingress-tuf-router.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- $host := pluck .Values.werf.env .Values.host | first | default .Values.host._default }}
{{- if hasPrefix "review" .Values.werf.env }}
{{- $host = ( printf "%s.%s" .Values.werf.env (pluck "dev" .Values.host | first | default .Values.host._default ) | lower ) }}
{{- end }}
{{- $ruHost := pluck .Values.werf.env .Values.ruHost | first | default (printf "ru.%s" $host) }}
{{- $ingressSecretName := pluck .Values.werf.env .Values.ingressSecretName | first | default .Values.ingressSecretName._default }}

apiVersion: networking.k8s.io/v1
Expand All @@ -16,7 +12,7 @@ spec:
- hosts:
- {{ $host }}
{{- if eq .Values.werf.env "production" }}
- {{ $ruHost }}
- ru.{{ $host }}
secretName: {{ $ingressSecretName }}
{{- else }}
- ru-{{ $host }}
Expand All @@ -41,7 +37,7 @@ spec:
port:
name: http
{{- if eq .Values.werf.env "production" }}
- host: {{ $ruHost }}
- host: ru.{{ $host }}
http:
paths:
- path: /targets/
Expand Down
10 changes: 3 additions & 7 deletions .helm/templates/20-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{{- $host := pluck .Values.werf.env .Values.host | first | default .Values.host._default }}
{{- if hasPrefix "review" .Values.werf.env }}
{{- $host = ( printf "%s.%s" .Values.werf.env (pluck "dev" .Values.host | first | default .Values.host._default ) | lower ) }}
{{- end }}
{{- $ruHost := pluck .Values.werf.env .Values.ruHost | first | default (printf "ru.%s" $host) }}
{{- $wwwHost := printf "www.%s" $host }}
{{- $ingressSecretName := pluck .Values.werf.env .Values.ingressSecretName | first | default .Values.ingressSecretName._default }}
{{- if eq .Values.werf.env "production" }}
Expand All @@ -24,7 +20,7 @@ spec:
- hosts:
- {{ $host }}
- {{ $wwwHost }}
- {{ $ruHost }}
- ru.{{ $host }}
secretName: {{ $ingressSecretName }}
rules:
- host: {{ $host }}
Expand All @@ -37,7 +33,7 @@ spec:
name: backend
port:
name: http
- host: {{ $ruHost }}
- host: ru.{{ $host }}
http:
paths:
- path: /
Expand Down Expand Up @@ -91,7 +87,7 @@ metadata:
ssi_silent_errors on;
{{- include "rewrites" . | indent 6 }}
nginx.ingress.kubernetes.io/auth-response-headers: X-Auth-Request-User,X-Auth-Request-Email
nginx.ingress.kubernetes.io/auth-signin: https://$host/dex-authenticator/sign_in
nginx.ingress.kubernetes.io/auth-signin: https://ru-{{ $host }}/dex-authenticator/sign_in
nginx.ingress.kubernetes.io/auth-url: https://werfio-ru-dex-authenticator.{{ $.Values.werf.namespace }}.svc.cluster.local/dex-authenticator/auth
spec:
ingressClassName: {{ include "ingressClassName" . }}
Expand Down
2 changes: 1 addition & 1 deletion .helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resources:
requests:
memory: {{ pluck .Values.werf.env .Values.resources.requests.memory | first | default .Values.resources.requests.memory._default }}
limits:
memory: {{ pluck .Values.werf.env .Values.resources.requests.memory | first | default .Values.resources.requests.memory._default }}
memory: {{ pluck .Values.werf.env .Values.resources.limits.memory | first | default .Values.resources.limits.memory._default }}
{{- end }}

{{- define "imagePullSecrets" }}
Expand Down
Loading