-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.33 KB
/
dc-discoverswiss-lodging.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
58
59
60
61
62
63
name: CI/CD dc-discoverswiss-lodging
on:
push:
paths:
- "collectors/discoverswiss-lodging/**"
- "!collectors/discoverswiss-lodging/infrastructure/helm/*"
- "collectors/discoverswiss-lodging/infrastructure/helm/values.yaml"
- ".github/workflows/dc-discoverswiss-lodging.yml"
env:
WORKING_DIRECTORY: collectors/discoverswiss-lodging
DOCKER_IMAGE: ghcr.io/noi-techpark/opendatahub-collectors/dc-discoverswiss-lodging
DOCKER_TAG: ${{ github.sha }}
KUBERNETES_NAMESPACE: collector
VALUES_YAML: infrastructure/helm/values.yaml
K8S_NAME: dc-discoverswiss-lodging
jobs:
build:
runs-on: ubuntu-22.04
concurrency: dc-rest-poller-discoverswiss-lodging-build
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
deploy-discoverswiss-lodging-test:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-22.04
concurrency: dc-rest-poller-discoverswiss-lodging-test
environment: test
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Customize values.yaml
working-directory: ${{ env.WORKING_DIRECTORY }}
run: |
yq -i '.image.repository = "${{ env.DOCKER_IMAGE }}"' ${{ env.VALUES_YAML }}
yq -i '.image.tag = "${{ env.DOCKER_TAG }}"' ${{ env.VALUES_YAML }}
yq -i '.image.pullPolicy = "IfNotPresent"' ${{ env.VALUES_YAML }}
yq -i '.envSecret.HTTP_HEADER_SUBSCRIPTION = "Ocp-Apim-Subscription-Key: ${{ secrets.HTTP_HEADER_SUBSCRIPTION_DISCOVERSWISS }}"' ${{ env.VALUES_YAML }}
- name: Deploy on cluster
uses: noi-techpark/github-actions/helm-deploy@v2
with:
k8s-name: dc-rest-poller-discoverswiss-lodging
k8s-namespace: collector
chart-path: helm/generic-collector
values-file: ${{ env.WORKING_DIRECTORY}}/${{ env.VALUES_YAML }}
aws-access-key-id: ${{ secrets[vars.AWS_KEY_ID] }}
aws-secret-access-key: ${{ secrets[vars.AWS_KEY_SECRET] }}
aws-eks-cluster-name: aws-main-eu-01
aws-region: eu-west-1